Understanding the Convert Command

Sarah Reichelt sarahr at genesearch.com.au
Sun Nov 21 19:01:48 EST 2004


Hi Greg,

No need for confusion or embarrassment :-)
This is a known bug that I was ranting about for months but I thought 
it had been fixed in Rev 2.5 - what version are you using?

Here is a link to the bug which will give you all the info.
<http://support.runrev.com/bugdatabase/show_bug.cgi?id=1162>

I wrote a bugFixConvert routine to do conversions without adding the 
hour and I have also written a routine that uses AppleScript to find 
the number of minutes or seconds of daylight saving currently in use. 
If you would like either of these, email me off-list.

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/

On 20 Nov 2004, at 4:23 pm, Gregory Lypny wrote:

> Having trouble understanding the Convert command.  I'm playing with 
> the following handler and using day/month/year format.
>
> on mouseUp
>   set useSystemDate to true
>   get fld "date"
>   convert it to long date and long time
>   put it into fld "converted date"
> end mouseUp
>
> The online documentation for the Convert command notes:
>
> "If you convert a date without a time to a form that includes the 
> time, the time will be given as 2 AM. (This is the default time 
> because it is the time of day when Daylight Savings Time begins and 
> ends.)"
>
> If I enter 1/10/2004 in the date field, I get Friday, October 01, 2004 
> 3:00:00 AM, which is not 2 AM.  And if I enter 1/10/2004 0:00:00, I 
> get Friday, October 01, 2004 1:00:00 AM.
>
> I have many events occurring at 11:45 PM, where my data file contains 
> entries with 23:45:00, but entering 1/10/2004 23:45:00 gives me 
> Saturday, October 02, 2004 12:45:00 AM.
>
> Finally, entering 1/10/2004 23:45:00 once again, and converting to the 
> long seconds gives me 1096692300, and converting back to the short 
> date and time gives me, 02/10/2004 12:45 AM, so I don't go back to 
> where I was before!
>
> Am I missing something obvious, or does the Convert command assume 
> that the day starts at 1 AM rather than the stroke of midnight?  The 
> same is true when converting to the dateItems.  Do I have to subtract 
> one hour from all of my data to use it reliably?
>
> 	Confused and likely embarrassed later,
>
> 		Greg



More information about the use-livecode mailing list