Plain simple unix timestamp with an HTTP GET
Ross
rossgk at gmail.com
Fri Jun 4 09:31:27 EDT 2010
On Jun 3, 11:20 pm, livibetter <livibet... at gmail.com> wrote:
> This?
>
> hwclock --utc --set --date="$(datestr="$(curlhttp://208.66.175.36:13/
> 2>/dev/null | cut -d \ -f 2-3)" ; echo ${datestr//-//})"
>
> Only hwclock, curl, cut, and Bash.
>
> PS. I didn't know I can set the time via hwclock, learned from Paul's
> post, but still didn't try to see if it does work.
>
>
Thanks for the info. Yes, I like the port 13 stuff from NIST et al
which is RFC 867 formatted, but on the hdwe the parsing is more
work.
Found a bit of port 37 RFC 868 stuff that sounds interesting. I am
able to get a long int from it now I think (e.g. 64.236.96.53:37 in
Virginia), though it seems to be a bit mangled, and doesn't work out
to the number I'd expect for a 1900 epoch. Still, I think it's usable,
and is just a single number.
I hear NIST is gradually getting away from RFC868 stuff tho' which is
too bad. Some of us don't need pS accuracy. +/- 5min is fine.
Thx for the input!
More information about the Python-list
mailing list