Problem with converting time

Mark Wieder ahsoftware at sonic.net
Sat Mar 18 01:36:41 CET 2017


On 03/17/2017 03:52 PM, Michael Doub via use-livecode wrote:
> Sorry Mark and Richard.   Here is the real code snipit that includes a
> hack that seems to work:
>
> getaData[x]["time"]
> if not(theenvironmentisamongtheitems"development,standalone
> application") then
>     subtract(4*60*60) fromit
> end if
> convertit todateitems

Weird copypasta stuff with spaces there.

>
> Mark, in your situation, you and the server are in the same timezone so
> I would not expect to see a problem.   I have no idea where my server
> is, but it must not be in my timezone.  I am guessing on the west coast
> since taking off 4 hours seems to fix the problem.

That just sounds wrong. If anything, it should be the other way around.

>
> It still does not make any sense why a timezone comes into play at all.

Timezone enters into the picture because if you ask the time, and then 
convert it to a readable format, you wouldn't expect to see UTC time 
unless you happened to live in that time zone. You're asking the server 
"what time is it where you live?" and asking the mac the same thing. The 
answers may or may not differ. If you want to be able to compare 
timestamps then "the internet date" will give you UTC time for both.

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list