date anomalies when converting to seconds

Dave Cragg dcragg at lacscentre.co.uk
Wed May 24 10:29:29 EDT 2006


On 24 May 2006, at 06:58, Kay C Lan wrote:
> Of course you do need to be careful of the centuryCutoff property  
> which is
> supposedly set to 35, and when I "put the centuryCutoff" I get 35 but:
>
> put "2006,05,23,12,12,12,9999999" into tMyDateTime
> add 11563 to item 3 of tMyDateTime
> convert tMyDateTime to dateItems
> put tMyDate
>
> result = 2038,1,18,12,12,12,2 --shouldn't be 2038 as the cutoff is 35
>
> add another day:
> put "2006,05,23,12,12,12,9999999" into tMyDateTime
> add 11564 to item 3 of tMyDateTime
> convert tMyDateTime to dateItems
> put tMyDateTime
>
> result = 1901,12,14,5,20,32,7 --note also that the time is no  
> longer the
> same!

I don't think this is a centuryCutoff problem but a year 2038  
problem. The seconds value can't be used for dates and times beyond  
3:14 am on January 18, 2038, which I guess translates into issues for  
the dateItems too. See here:

   http://home.netcom.com/~rogermw/Y2038.html

I may be wrong, but I think the centuryCutoff only affects  
conversions from 2-digit dates to 4-digit dates, e.g. from "the date"  
to "dateItems".

Cheers
Dave



More information about the use-livecode mailing list