Retrieving Date and Time From The Internet

Bob Sneidar bobs at twft.com
Tue Aug 16 18:11:03 EDT 2011


Thanks Waren and Scott. I will have a look at those. I can extrapolate UTX time from those zones I suppose, and then do the math for the particular time zone in the system settings. 

Thanks. 
Bob


On Aug 16, 2011, at 2:10 PM, Warren Samples wrote:

> On Tuesday, August 16, 2011 11:13:58 AM Bob Sneidar wrote:
>> Okay, I contacted the USNO site via email and requested that they include the year in the returned date/time. 
> 
> You could try this:
> 
> http://www.worldtimeserver.com/current_time_in_CA-QC.aspx
> 
> Your time info is here in the html it returns (example):
> 
>                                        <div id="analog-digital">
>                                            <span class="font7">
>                                                5:10 PM
>                                            </span>
>                                        </div>
>                                        <strong>
>                                            Tuesday, August 16, 2011</strong>
>                                        <br />
>                                        <span class="font1">
>                                            Eastern Daylight Time (EDT) -0400 UTC
> 
> Isolate this from the rest of the source and filter out the lines that begin with <, and you'll have what you're looking for. If you want a different city, just select one 
> from the list and copy that URL.
> 
> Warren
> 
> _______________________________________________
> 

> A fun challenge.  Here's one option, limited to a single time (US Eastern),
> with no guarantee of reliability (can any Web-based service truly claim
> this?):
> 
> function timeStamp
>   put url "http://www.atomictime.net/front.html" into temp
>   wait 500 millisecs with messages
>   put url "http://www.atomictime.net/time_tel.html?2" into temp
>   repeat with N = number of lines of temp down to 1
>      if line N of temp is not empty then return line N of temp
>   end repeat
> end timeStamp
> 
> The reason for the dual URLs is the host requires initial access through a
> home page.  Only thing I can guess is there's some back-end foolery going on
> that's not accessible (at least I can't see anything that's apparent, but
> maybe that's just me).
> 
> I tried setting my system clock back 2 hours and the page continues to
> return the current Eastern time, so the service *appears* to be legit.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design




More information about the Use-livecode mailing list