[ python-Bugs-697989 ] Clarify mktime semantics

SourceForge.net noreply at sourceforge.net
Mon May 28 04:33:04 CEST 2007


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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Erland Lewin (erl)
Assigned to: Jeremy Hylton (jhylton)
Summary: Clarify mktime semantics

Initial Comment:
Python Library Reference, Chapter 6.9

mktime: I believe the C mktime calls ignore the weekday
and Julian day values in the tuple. I therefor assume
that the Python function also does so, which should be
documented.


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

Comment By: Martin Blais (blais)
Date: 2007-05-28 02:33

Message:
Logged In: YES 
user_id=10996
Originator: NO

This is somewhat related to this bug/patch:
http://sourceforge.net/tracker/index.php?func=detail&aid=1726687&group_id=5470&atid=105470

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

Comment By: Tim Peters (tim_one)
Date: 2003-03-06 19:01

Message:
Logged In: YES 
user_id=31435

Yup, I agree the spec is clear on this specific point.  I'd rather 
the docs refer users to the platform C docs, though, as many 
other aspects of mktime can and do vary across 
implementations (for example, C is silent on the origin of the 
epoch, while POSIX defines it; C and POSIX are both clear as 
mud about how out-of-range struct tm members are to be 
treated; etc -- google for mktime man pages to see what a 
mess this function really is across platforms).

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

Comment By: Erland Lewin (erl)
Date: 2003-03-06 15:44

Message:
Logged In: YES 
user_id=116933

I have a draft of the C99 standard, which in paragraph
7.23.2.3 describes mktime, and says:

"The original values of the tm_wday and tm_yday components
of the structure are ignored..."

So, I would say that mktime() is *not* underspecified by ISO C.

In order to write correct programs, it is neccessary to know
the semantics of the functions, and IMHO the manual should
specify what can be expected of them.


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

Comment By: Tim Peters (tim_one)
Date: 2003-03-05 19:05

Message:
Logged In: YES 
user_id=31435

Python does (for the most part) inherit mktime semantics 
from the platform C, but mktime() is "underspecified" by 
ANSI C and there's little that can be said about oddball 
cases across platforms.  Sometimes it even depends on 
the preprocessor symbols defined when the platform C 
library was compiled.

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

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


More information about the Python-bugs-list mailing list