This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, martin.panter, serhiy.storchaka
Date 2017-10-30.01:54:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAP7h-xZ0Hks_6zejGhZt-FMgf2J1kpqhawWOhwMtu9aq3y_kPA@mail.gmail.com>
In-reply-to <1509327003.95.0.213398074469.issue31894@psf.upfronthosting.co.za>
Content
> The documentation only says “datetime.timestamp” calls “mktime”

Indeed.  See <https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp>.

This is a documentation bug.  Since 3.6 the timestamp does not call
mktime.  In fact, mktime should not be called anywhere in the datetime
module. See <https://github.com/python/cpython/blob/a2314283ff87c65e1745a42c2f2b716b1a209128/Modules/_datetimemodule.c#L5315>.

For the explanation of why mktime is not a good API, see PEP 495.

On Sun, Oct 29, 2017 at 9:30 PM, Martin Panter <report@bugs.python.org> wrote:
>
> Martin Panter <vadmium+py@gmail.com> added the comment:
>
> Are you sure it is a “system” bug? As far as I understand, at least Posix does not require support for local time before 1970. See <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16>.
>
> But why is localtime(14400) relevant? The documentation only says “datetime.timestamp” calls “mktime”, which should be valid since the UTC-5 timezone offset will give a positive timestamp. Perhaps is this similar to Issue 29097, probing a date before 1970?
>
> ----------
> nosy: +martin.panter
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue31894>
> _______________________________________
History
Date User Action Args
2017-10-30 01:54:59belopolskysetrecipients: + belopolsky, martin.panter, serhiy.storchaka
2017-10-30 01:54:59belopolskylinkissue31894 messages
2017-10-30 01:54:57belopolskycreate