Problem with converting time

Michael Doub mikedoub at gmail.com
Fri Mar 17 08:56:02 EDT 2017


Richard here is another example:

time = 1489752000

mac: dateitems = 2017,3,17,8,0,0,6

server: dateitems = 2017,3,17,12,0,0,6

I just wanted to double check that I was showing you good comparison 
since I am copying from multiple windows of debug output.

-= Mike

On 3/17/17 8:46 AM, Michael Doub wrote:
>
> time = 1489755600
>
> Mac:      dateitems = 2017,3,17,9,0,0,6
> server:   dateitems = 2017,3,17,12,0,0,6
>
> Code:   get time
> convertit to dateitems
>
> I don't understand how the local time comes into play when converting 
> a constant number of seconds.  The resulting date should be a constant 
> as well.
>
> What am I missing?
>
> -= Mike
>
>
> On 3/16/17 4:05 PM, Richard Gaskin via use-livecode wrote:
>> Michael Doub wrote:
>>
>> > I am getting different answers based on environment when trying to
>> > convert EPOC seconds to dateitems or internet date.   On my mac I get
>> > the expected result but on a HostM server I get something totally
>> > different.
>>
>> How different?
>>
>> > Does any one have a conversion function that does not use the
>> > livecode's convert function that they would be willing to share?
>>
>> The seconds are usually a very good choice for their compactness and 
>> ease of calculation, and more so because the value we get is in GMT 
>> based on the offset from host OS.
>>
>> What this should mean is that you can convert values obtained from 
>> "the seconds" and get a good date/time regardless of which time zone 
>> you're in.
>>
>> So seconds are usually ideal (along with "internet date") for network 
>> applications such as the one you're working on.
>>
>> But for the conversion to take your local system into account, you'll 
>> need to do the conversion locally.
>>
>> If you're doing the conversion on the server, the date/time will 
>> reflect the time zone settings in the server OS.
>>
>




More information about the use-livecode mailing list