Alternative HTTP/HTTPS response?

216 views
Skip to first unread message

Daniel Waylonis

unread,
Mar 21, 2019, 3:23:47 AM3/21/19
to public-ntp-discuss
Hi,

Rather than redirect to "https://developers.google.com/time", it would be useful to have the ability for time.google.com:80 to respond with the current time value with some formatting parameters.

For example, these would be useful:

Thu, 21 Mar 2019 07:15:30 +0000

Thu, 21 Mar 2019 07:15:30 +0000

{"time": "Thu, 21 Mar 2019 00:15:30 -0700"}

{"time": "Thu, 21 Mar 2019 00:15:30 -0700"}

Thanks!
Dan



Michael Shields

unread,
Mar 21, 2019, 2:54:53 PM3/21/19
to Daniel Waylonis, public-ntp-discuss
What would you use this for?
> --
> 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/f917a3c3-5e16-4d1d-8f67-ee76b3415ca7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Daniel Waylonis

unread,
Mar 21, 2019, 3:22:15 PM3/21/19
to Michael Shields, public-ntp-discuss
Hi Michael,

I have a small embedded device (https://www.espruino.com) that doesn’t have a real-time clock or NTP library support but it does have networking and WiFi.

Additionally, it has library support for setting the devices date from ISO 8601 time string.

On bring up, the device could contact time.google.com, get the current time, and set the devices time to that time. Would be even cooler if based on the IP address, the response could estimate the TZ information.

I do see (via curl) that the redirect response does include the “Date” header but I don’t think the Espruino library has support for extracting the header information, just the returned data.

Dan

-----------------------------------------
Dan Waylonis | gmail.com


Jamie Wilkinson

unread,
Mar 21, 2019, 10:12:23 PM3/21/19
to Daniel Waylonis, Michael Shields, public-ntp-discuss
You might be interested in Roughtime, which is "mostly accurate but secure time" over HTTPS: https://roughtime.googlesource.com/roughtime

NTP doesn't have a concept of timezone.  You might be interested as well in looking instead at DHCP, particularly the extensions by which a DHCP server can provide a client with its timezone and preferred NTP server.

Sergei Genchev

unread,
Mar 22, 2019, 10:41:03 AM3/22/19
to public-ntp-discuss
Hi Michael,

Many ISPs nowadays block outbound port 123 to 'unknown' NTP servers. Supposedly to thwart NTP based DDOS amplification attacks. We did run into this problem with our devices. Ability to get time over HTTP would be very helpful.
To unsubscribe from this group and stop receiving emails from it, send an email to public-ntp-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages