[New-bugs-announce] [issue4775] Incorrect documentation - UTC time

"Martin v. Löwis" martin at v.loewis.de
Tue Dec 30 09:46:57 CET 2008

> The difference is that UTC includes leap seconds, whereas UT1 does not (see <http://en.wikipedia.org/wiki/Coordinated_Universal_Time>). The 
> conversion routines ignore leap seconds, e.g., (time.mktime((2000,1,1,12,0,0,0,0,0))-
> time.mktime((1990,1,1,12,0,0,0,0,0))) returns an exact multiple of 
> 24*60*60 and does not include all the leap seconds added between those 
> dates. 

Read the documentation carefully. It doesn't claim that mktime uses UTC,
and claiming that it uses UT1 would be equally incorrect. Instead,
mktime uses local time (as documented). Whether that includes leap
seconds or not depends on the definition of your time zone in your
operating system.

Also notice that the Unix time (time_t) is discontinuous with respect
to leap seconds; each day time_t advances by 86400 seconds even if there
was a leap second on that day; see


So even if your time zone includes leap seconds, then mktime still
correctly computes the difference as multiple of 86400.

Which specific other usage of UTC do you also consider incorrect?

More information about the New-bugs-announce mailing list