date anomalies when converting to seconds

Chris Sheffield cmsheffield at gmail.com
Mon May 22 14:30:57 EDT 2006


Thanks, Jim. However, I'm not totally sure this will really help me,  
as I'm not really having a problem with daylight savings. The dates  
I'm dealing with are entered by the user. They are not gotten from  
the computer's clock. All I am doing is converting these dates to  
seconds, which is where the problem lies. Or does that conversion  
process rely on the computer's clock being accurate? Doesn't seem  
like it should. And like I said, some dates convert correctly.

Do you recall if there was specific mention of a problem like this in  
the discussion you mentioned? If so, I'll spend a little more time  
searching the archives, but I'm not totally convinced that discussion  
relates in this case.

Thanks,
Chris


On May 22, 2006, at 10:37 AM, Jim Ault wrote:

> If you look in the archives, this topic was recently discussed  
> fairly well.
> The operating systems do date and time and daylight savings  
> differently.
> This is inherent in each system.  If these calculations are  
> critical to your
> operation, you should invest a bit of time building a small date-time
> library to add to your distribution.
>
> Hopefully you will find all the data you need to answer your  
> questions,
> especially if you are going to rely on the users computer settings  
> as being
> accurate and in their time zone.
>
> Look at the automatic daylight savings time adjustment for each  
> operating
> system, and in other countries, see which day this is invoked.
>
>
> Jim Ault
> Las Vegas
>
>
> On 5/22/06 8:39 AM, "Chris Sheffield" <cmsheffield at gmail.com> wrote:
>
>> This is one for those of you developing for both Mac and Windows. I'm
>> running into a very strange problem, and I'm not sure if it's a Rev
>> bug or if it has something to do with hardware differences between
>> Macs and PCs.
>>
>> Here's a code snippet:
>>
>> put "01/06/2006" into tDate
>> convert tDate to seconds
>> put tDate
>>
>> Run this in the message box on both a Mac and a PC. See the different
>> results. Anyone know why this would happen? What I'm ultimately doing
>> is converting two dates to seconds and then calculating the number of
>> weeks that have passed between the two dates. I discovered that my
>> calculations were incorrect on the PC, and my debugging led me to
>> this. The value on the Mac seems to be the correct one. What's
>> strange is some dates seem to be correct when converting to seconds,
>> but others are not. Try "04/28/2006" for example. Converting to
>> seconds results in the same value on both platforms.
>>
>> Can anyone help with this? Or does anyone have another way of
>> calculating the number of weeks between two dates without converting
>> to seconds first? Have I found a bug I need to report?
>>
>> Thanks,
>> Chris
>>
>> ------------------------------------------
>> Chris Sheffield
>> Read Naturally
>> The Fluency Company
>> http://www.readnaturally.com
>> ------------------------------------------
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------





More information about the use-livecode mailing list