Did anybody notice that the interval of second in Python datetime is [00,61] see the table in the bottom of this page. http://docs.python.org/library/datetime.html#strftime-strptime-behavior
Why?
Did anybody notice that the interval of second in Python datetime is [00,61] see the table in the bottom of this page. http://docs.python.org/library/datetime.html#strftime-strptime-behavior
Why?
The answer is a little further down in the page:
The range really is 0 to 61; according to the Posix standard this accounts for leap seconds and the (very rare) double leap seconds. The time module may produce and does accept leap seconds since it is based on the Posix standard, but the datetime module does not accept leap seconds in strptime() input nor will it produce them in strftime() output.
This is an interesting behavior, indeed.
There is no such thing as a double leap second. There cannot be 62 seconds in a minute. 59, yes. 60, yes. 61, yes. 62, no.
http://www.monkey.org/openbsd/archive2/tech/199905/msg00031.html
When you have to add leap second it will be helpful to calculate that. You can search on net for leap second. Due to that second range in python is 0-61
.
Leap seconds.
It has been the case that there have been 62 seconds in a minute in the past.
It adjusts for the world spinning slower.
Part of this is down to tides. The energy for the tides comes from the rotation of the earth and moon. The result is that the world slows down.
If global warming takes place the oceans get hotter and expand. That is like a skater throwing their arms out, and the spin slows down. That hasn't taken place. The measurement of ocean levels doesn't agree with the rotation measurements. It's likely to be down to problems with the earth's surface moving, which is far larger than the sea level rise.