Internet Date Service test

Mark Wieder ahsoftware at sonic.net
Sat Sep 15 00:24:59 EDT 2018


On 09/14/2018 08:30 PM, Peter Bogdanoff via use-livecode wrote:
 > I’m not seeing how to translate use of an NTP server into "LC-talk.” 
I would love to use it but Google doesn’t seem to have an API that I can 
access. And I would love the dependability of the Google universe.

NTP uses port 13.

constant kNTPsocket = "time.nist.gov:13"

on mouseUp pMouseButton
    open socket to kNTPsocket with message "opened"
    if the result is not empty then
       put the result after msg
    end if
end mouseUp

on opened
    local tTime

    read from socket kNTPsocket until EOF
    put it into tTime
    put tTime after msg
    close socket kNTPSocket
end opened

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list