BUG in CONVERT command - or I can't tell the time

Michael D Mays michael at GreppyDreppies.com
Mon Apr 22 06:58:01 EDT 2002


When it is 12 midnight in Edinburgh (GMT) it is 6:00 PM the day before here
in Dallas (CST) (no daylight savings time). And that is the way it should
be. If a child was born at zero seconds, okay 1 second, in Edinburgh a year
later in Dallas at 6:00:01 PM on Dec 31st she would be a year old.

IMO, date and time formats should only be used to display dates and times.
Aside from formatting issues, as illustrated here time and date formats have
'hidden parameters' such as where (time zone) and when (daylight savings
time) associated with them.

If you use time and date formats to to calculate time differences you will
find several glitches in your calculations. Daylight savings time can add
and subtract an hour and even give you a negative time (which can be
particularly troublesome).

Using the additional 'system' parameter doesn't solve these problems.

Use seconds or dateItems to store and calculate your dates and times if you
need to do calculations with them. Note, dateItems records the date and time
information as local.

michael

Dar Scott of dsc at swcp.com wrote the following on 4/21/02 10:00 PM

> On Sunday, April 21, 2002, at 08:18 PM, Michael D Mays wrote:
> 
>> That is what the documentation says. 0 seconds is 12 midnight, Jan
>> 1, 1970
>> GMT.
> 
> I get 6:00 PM
> 
> (I was sure 0 used to get an error for me, too, I'm not sure what's
> up with that.)




More information about the use-livecode mailing list