Grabbing the Date and Time From a Time Server on the Internet

Pete pete at mollysrevenge.com
Mon Aug 15 18:50:35 EDT 2011


I missed the beginning of this thread so I'm probably missing the point
here, but what's wrong with using the LC "internet date"?
Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Mon, Aug 15, 2011 at 3:19 PM, Bob Sneidar <bobs at twft.com> wrote:

> I may have sent you a version that was bugged. This is the final one I came
> up with:
>
> function realTime theFormat, useOffset
>   if useOffset is empty then put false into useOffset
>   put "http://tycho.usno.navy.mil/cgi-bin/timer.pl" into theURL
>   get url theURL
>   put it into theResult
>   filter theResult with "<BR>*UTC*"
>   replace "<BR>" with empty in theResult
>   put word 1 to 3 of theResult into theResult
>   if useOffset then
>      put word -1 of theResult into theTime
>      put word -1 of the internet date into theZoneOffset
>      put theZoneOffset /100 into theZoneOffset
>      set the itemdelimiter to ":"
>      put (item 1 of theTime + theZoneOffset) into item 1 of theTime
>      put theTime into word -1 of theResult
>   end if
>
>   if theFormat is "seconds" then
>      put word -1 of theResult into theResult
>      convert theResult to seconds
>   end if
>
>   return theResult
> end realTime
>
> Bob
>
>



More information about the use-livecode mailing list