DST Gotcha


Author Message
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2981
Posted: 08:59pm 11 Mar 2012      

  DuinoMiteMegaAn said   Today is DST (Daylight savings time in the US) and with my time/date algorithms I was expecting a hour increase.

You would think that a simple compare would work like

IF Date$ = "11-3-2012" then increase_time_1_hr <------- does not work

A print of Date$ reveals 11-3-2012 <----- The same as the string above ? Both are the same?

The trouble is the LEN of Date$ is 10 chars and the LEN of "11-3-2012" is 9 chars?

I had to convert the Date$ back to numbers and back to strings again for
the compare!

BTW ... Another way is to make sure the compare string/array is LEN of 10.
"11-3-2012" changed to "11-03-2012"


Hi DuinoMiteMegaAn,

How did you get a Date$ without the 0 in the middle? Mine always prints in the format of 11-03-2012 ...

So a compare with 11-3-2012 would never work.

Am I confused here, I seem to be missing something.

Mick