[issue36439] Inconsistencies with datetime.fromtimestamp(t) when t < 0

Paul Ganssle report at bugs.python.org
Fri Nov 1 10:54:46 EDT 2019


Paul Ganssle <p.ganssle at gmail.com> added the comment:

This has been coming up in a few different contexts lately, so I think it would be really good if we could get some sort of fix for it.

One option is to implement our own versions of these APIs for use in Windows, but a thought occurred to me recently: we have not investigated the possibility of seeing if Microsoft would be willing to either add support for negative timestamps in their localtime() or gmtime() implementations or add a new API that *does* support negative timestamps. It would also be good to rule out the possibility that such APIs already exist but we just don't know about them (preliminary googling doesn't show anything, though possibly something can be done with the Win32 APIs? Not sure how or if those work in C and how big a lift it would be to maintain compatibility if can switch: https://docs.microsoft.com/en-us/windows/win32/sysinfo/time-functions?redirectedfrom=MSDN ).

Adding Steve Dower to the nosy list in case he can shed some light onto the possibility of native support.

----------
nosy: +steve.dower

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36439>
_______________________________________


More information about the Python-bugs-list mailing list