[Python-bugs-list] [ python-Bugs-697989 ] Clarify mktime semantics
SourceForge.net
noreply@sourceforge.net
Thu, 06 Mar 2003 11:01:59 -0800
Bugs item #697989, was opened at 2003-03-05 08:46
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=697989&group_id=5470
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Erland Lewin (erl)
Assigned to: Nobody/Anonymous (nobody)
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: Tim Peters (tim_one)
Date: 2003-03-06 14: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 10: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 14: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