24 hours doesn't exist - it's 0!
Midnight 22/10/2012 to Midnight 29/10/2012 would be 7 days exactly.
The first: mktime(0, 0, 0, 10, 22, 2012)
The second: mktime(0, 0, 0, 10, 29, 2012)
BUT, daylight saving (UK anyway) ends on 28/10/2012, so you gain an extra hour!
See here: http://www.timeanddate.com/worldclock/clockchange.html?n=136
I've run into this many-a-time with calculations using unix timestamps, so you gotta be careful. DST settings and leap years can really mess your apps.
diafol
Keep Smiling
10,672 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
Question Answered as of 7 Months Ago by
diafol Yeah, you got it. :)
BTW mktime() can utilize overflow and underflow - such as mktime(25,0,0, 10, 28, 2012) - which WILL work, and can be extremely useful - BUT this can often lead to confusion when dealing with '24', as (as you know) there is no 24:00:00.
diafol
Keep Smiling
10,672 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57