| ▲ | nightpool 5 hours ago | ||||||||||||||||||||||
The minute between December 31, 2016 23:59 and January 1st 2017 is 61 seconds, not 60 seconds. The hour that contains that minute is 3601 seconds, the day that contains that hour is 43201 seconds, etc. If you assume a fixed duration and simply multiply by 43200, your math will be wrong compared to the rest of the world. Daylight savings time makes a day take 23 hours or 25 hours. That makes a week take 7254000 seconds or 7261200 seconds. Etc. | |||||||||||||||||||||||
| ▲ | woodruffw 5 hours ago | parent | next [-] | ||||||||||||||||||||||
That’s what I mean by calendar units. These aren’t issues if you don’t try to apply durations to the “real” calendar. (This is all in the context of cooldowns, where I’m not convinced the there’s any real ambiguity risk by allowing the user to specify a duration in day or hour units rather than seconds. In that context a day is exactly 24 hours, regardless of what your local savings time rules are.) | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | _alternator_ 4 hours ago | parent | prev [-] | ||||||||||||||||||||||
Leap seconds are their own nightmare. UNIX time ignores them, btw, so that the unix epoch is 86400*number of days since 1/1/1970 + number of seconds since midnight. The behavior at the instance of a leap second is undefined. | |||||||||||||||||||||||
| |||||||||||||||||||||||