Are there code samples for obtaining the current date and time from a software program? c++ would be best.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
To post to this group, send email to public-ntp-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/5e157606-aab7-4da5-a9c8-f13a2da2baa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The time.google.com service provides NTP, most NTP libraries should work. You can find several examples of NTP clients written in C++ on GitHub and StackOverflow.I do not know your use case but you should be aware of inaccuracy caused by network latency and understand that changing the system clock, especially backwards, can have unexpected consequences.
On Tue, Mar 7, 2017 at 7:46 AM, רות ומיכאל האפרתי <myma...@gmail.com> wrote:
Are there code samples for obtaining the current date and time from a software program? c++ would be best.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
I suppose, this question is interesting not only to C++ coders.I have to get time on a controller. I can establish UDP connection to an ntp server but no libraries for udp are available for me.So, can i manually send a request to UDP 216.239.35.0:123 and get a string to parse? I tried sending empty messages with packet sender, but it didn't work.
Or are there any services (not NTP, but constant IP), which can respond my TCP or UDP request with a string containing time and date?
вторник, 7 марта 2017 г., 18:54:55 UTC+3 пользователь Chris Schrier написал:
The time.google.com service provides NTP, most NTP libraries should work. You can find several examples of NTP clients written in C++ on GitHub and StackOverflow.I do not know your use case but you should be aware of inaccuracy caused by network latency and understand that changing the system clock, especially backwards, can have unexpected consequences.
On Tue, Mar 7, 2017 at 7:46 AM, רות ומיכאל האפרתי <myma...@gmail.com> wrote:
Are there code samples for obtaining the current date and time from a software program? c++ would be best.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/5e157606-aab7-4da5-a9c8-f13a2da2baa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
To post to this group, send email to public-ntp-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/f6acf75f-bf75-45ff-b4b2-0d2edad640a7%40googlegroups.com.
You can send NTP packets to that IP and it will respond to them. Sending an empty packet won't work.If you read the NTP v3 spec (RFC 1305) or any later one, and implement that on your controller, then you should have some success.(You should also be able to send packets to *any* public NTP server, e.g. pool.ntp.org, to test your controller code.)
On 11 March 2017 at 19:43, Eugen S <letit...@gmail.com> wrote:
I suppose, this question is interesting not only to C++ coders.I have to get time on a controller. I can establish UDP connection to an ntp server but no libraries for udp are available for me.So, can i manually send a request to UDP 216.239.35.0:123 and get a string to parse? I tried sending empty messages with packet sender, but it didn't work.
Or are there any services (not NTP, but constant IP), which can respond my TCP or UDP request with a string containing time and date?
вторник, 7 марта 2017 г., 18:54:55 UTC+3 пользователь Chris Schrier написал:
The time.google.com service provides NTP, most NTP libraries should work. You can find several examples of NTP clients written in C++ on GitHub and StackOverflow.I do not know your use case but you should be aware of inaccuracy caused by network latency and understand that changing the system clock, especially backwards, can have unexpected consequences.
On Tue, Mar 7, 2017 at 7:46 AM, רות ומיכאל האפרתי <myma...@gmail.com> wrote:
Are there code samples for obtaining the current date and time from a software program? c++ would be best.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/5e157606-aab7-4da5-a9c8-f13a2da2baa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
Thanks for the followup, Eugen!
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-disc...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/5e157606-aab7-4da5-a9c8-f13a2da2baa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-disc...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/f6acf75f-bf75-45ff-b4b2-0d2edad640a7%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "public-ntp-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-disc...@googlegroups.com.
To post to this group, send email to public-nt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/public-ntp-discuss/e675a77e-801e-4ba9-b9b0-642b1ece7af3%40googlegroups.com.