[Python-bugs-list] [ python-Bugs-737127 ] time.mktime() year < 1969 broken? time.accept2dyear=0

SourceForge.net noreply@sourceforge.net
Tue, 13 May 2003 09:32:43 -0700


Bugs item #737127, was opened at 2003-05-13 11:52
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=737127&group_id=5470

>Category: Windows
>Group: Platform-specific
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Rich Landers (rt_landers)
>Assigned to: Tim Peters (tim_one)
Summary: time.mktime() year < 1969 broken? time.accept2dyear=0

Initial Comment:
I cant seem to get years < 1970 to be accepted by
time.mktime() under ANY circumstances.  From the 
module-time documentation, I thought they should work if I 
set  time.accept2dyear= 0 and/or used 4-digit years.

My platform is Python 2.2.2 on Windows 2000.
I also have Mark Hammond's "win32all-152" installed.

The attached test behaves the same way on
Python 2.2.1 on Linux (RedHat 8.0)

Summary:

time.accept2dyear =  0
tmtuple =  [1969, 1, 1, 0, 0, 0, 0, 1, -1]
time.mktime(tmtuple) = 

Traceback (most recent call last):
  File "timetest.py", line 24, in testMkTime
    print 'time.mktime(tmtuple) = ', time.mktime(tmtuple)
OverflowError: mktime argument out of range



----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2003-05-13 12:32

Message:
Logged In: YES 
user_id=31435

Sorry, you're seeing a limitation of the platform mktime() 
implementation.  Do a google search for "mktime msdn".  The 
top hit will take you to the Microsoft docs for their mktime() 
implementation.  The year restrictions are documented there, 
and Python inherits them.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=737127&group_id=5470