Problem with converting time

Sannyasin Brahmanathaswami brahma at hindu.org
Sun Mar 19 23:56:21 EDT 2017


Hmm, this is odd if you are located in North Carolina…it means your server is off shore, out in the Atlantic, because it is running 3 hours ahead of you. but, unless HostM has now floatilla ISP data center ships, or secret bunkers on the sea floor, something is amiss.

Ditto everything Richard already said Thanks Richard! Your prolific penchant for mentoring/documentation is really appreciagted!  I saved all that to my reference here…

put 1489755600 into tVar
convert tVar into dateitems
   -- on the mac tVar contains 2017,3,17,9,0,0,6  # North Carolina
   -- on the server tVar contains 2017,3,17,12,0,0,6 # Huh!  three hour ahead ?

Am I daft? this seem impossible as this indicates 9 am in NC = 12 noon on the server.

I had issues a long time ago, because the ISP would spin up an instance of Linux using a disk image--  some generic OS image. They never bothered to reset the time zone for the OS…many ISP tech's  assume the user is savvy -- "Well, it's your server, set it up the way you like it.") and will want to do that themselves.   

But naïve users don’t give it a second thought and I got these weird results until I checked, like Richard suggested, the time and zone on the server itself and reset them. There was a time when I thought it would be cool to set the time zone of the OS in California to the same time zone as Hawaii (local) but later this turned about to be a bad strategy because, really, like Richard said, you want everything to be "the same moment" around the global, which of course means, the time in each location, for that moment will be different.   Any other way…  "therein lies madness"  

I had to master the simple "art" of understanding GMT and local conversions.  So if your host is in Texas, make sure the TZ/Time on the "box" is correct for its real, physical locationin Dallas or where ever… and then if you want the web page to "pretend" the server is in NC, you would add time to the output. (or subtract time from your inputs in your scripts.) 

interesting related resource : https://www.epochconverter.com/

https://www.epochconverter.com/clock

BR


 





More information about the use-livecode mailing list