October's Bug ?

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
NoN'
Posts: 96
Joined: Thu Jul 03, 2008 9:56 pm
Contact:

October's Bug ?

Post by NoN' » Tue Jul 19, 2011 9:07 pm

Is there a strange October's Bug in LiveCode ?

Working on an old hypercard project adapted under LiveCode, I've noted the strange behavior of a script intended to calculate dates.
when I try this (in message box for instance)

Code: Select all

put "10/30/2011" into theDate
convert theDate to seconds
add "86400" to theDate
convert theDate to long date
put theDate  --- or answer the date
I obtain :

"Sunday, October 30, 2011" !!



where I should obtain "Sunday, October 31, 2011". And it's the same thing with :
  • "10/31/2010" ( 1288476000 secs )
    "10/28/2012" ( 1351375200 secs )
    "10/27/2013" ( 1382824800 secs )
    "10/26/2014" ( 1414274400 secs )
    "10/25/2015" ( 1445724000 secs )
...and before (as : 10/25/2009) and surely after. Is someone, here, could test this script on different IT environment than mine ?

Oh, a clue : all the date are sundays.

this bug, if it is one, could have adverse consequences in some cases.

NoN'
working on a new/old iMac intel, Leopard and Livecode v.4.5.3

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: October's Bug ?

Post by FourthWorld » Tue Jul 19, 2011 10:04 pm

NoN' wrote:Working on an old hypercard project adapted under LiveCode, I've noted the strange behavior of a script intended to calculate dates.
when I try this (in message box for instance)

Code: Select all

put "10/30/2011" into theDate
convert theDate to seconds
add "86400" to theDate
convert theDate to long date
put theDate  --- or answer the date
I obtain :

"Sunday, October 30, 2011" !!



where I should obtain "Sunday, October 31, 2011".
I get "Monday, October 31, 2011" in both v4.5.3 and 4.6.2
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

wsamples
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 264
Joined: Mon May 18, 2009 4:12 am

Re: October's Bug ?

Post by wsamples » Tue Jul 19, 2011 10:05 pm

Running your script in the message box here returns "Monday, October 31, 2011". Livecode 4.6.2, openSUSE.

What happens if you add an hour or two hours? Are these the only dates you've found that are goofy? This appears to be related to the end of Daylight Savings Time which happens to occur on those dates in France.

NoN'
Posts: 96
Joined: Thu Jul 03, 2008 9:56 pm
Contact:

Re: October's Bug ?

Post by NoN' » Tue Jul 19, 2011 10:39 pm

Richard, WSamples,

Thank you for your answers and for the test.

@wsamples :

thank you for this light. I ignored the problem of "the end of Daylight Savings Time " in France.
So, as you have suggested to me, I've tried by adding two additional hours and... it works fine now.

Code: Select all

put "10/30/2011" into theDate
convert theDate to seconds
add "93600" to theDate
convert theDate to long date
put theDate
retun : "Monday, October 31, 2011"

Thanks again

Renaud

Post Reply