diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-09-18 11:36:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-09-18 11:36:17 (GMT) |
commit | 9a8b177e60cc5cc6d5105519c0df8fb185211e1d (patch) | |
tree | 83036f077d2267d3c60f172242de4ee8892a5323 /setup.py | |
parent | 4b352171d2b0a4a63cd711df9ebe840419137fa2 (diff) | |
download | cpython-9a8b177e60cc5cc6d5105519c0df8fb185211e1d.zip cpython-9a8b177e60cc5cc6d5105519c0df8fb185211e1d.tar.gz cpython-9a8b177e60cc5cc6d5105519c0df8fb185211e1d.tar.bz2 |
Issue #25155: Add _PyTime_AsTimevalTime_t() function
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.
Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.
Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions