Retrieving Date and Time From The Internet
bobs at twft.com
Wed Aug 17 12:15:20 EDT 2011
You guys never cease to amaze me. Well done! Now if a single developer can produce results like this overnight, I wonder why the very capable devs at RunRev cannot create a world time that does the same thing?
> this thread made me curious...
> I present to you a simple SNTP stack
> go stack "http://andregarzia.com/stacks/libNTPToy.livecode"
> It is a quick and dirty implementation with no error checking. It has one
> function getTime(), you pass the NTP server and it returns the current date
> and time in seconds format. I tried with our official Brazilian time servers
> and it worked.
> Hope this helps. By the way, I don't truly understand the NTP protocol, I
> picked a couple ruby and python code and converted to livecode with the aid
> of wireshark marvelous sniffer tool to see the damn datagrams flowing. (I
> hate binary protocols)
On Aug 16, 2011, at 10:35 PM, stephen barncard wrote:
> I thought it could be done directly with a time server, and one can!
> I did some dicking around with sockets and made this up.
> this uses the Daytime Protocol
> function returnNISTime
More information about the Use-livecode