Kaydet (Commit) 265e1259 authored tarafından Victor Stinner's avatar Victor Stinner

Issue #23517: datetime.datetime.fromtimestamp() and

datetime.datetime.utcfromtimestamp() now rounds to nearest with ties going away
from zero, instead of rounding towards minus infinity (-inf), as Python 2 and
Python older than 3.3.
üst 74474232
......@@ -17,6 +17,11 @@ Core and Builtins
Library
-------
- Issue #23517: datetime.datetime.fromtimestamp() and
datetime.datetime.utcfromtimestamp() now rounds to nearest with ties going
away from zero, instead of rounding towards minus infinity (-inf), as Python
2 and Python older than 3.3.
- Issue #23552: Timeit now warns when there is substantial (4x) variance
between best and worst times. Patch from Serhiy Storchaka.
......
......@@ -4098,7 +4098,7 @@ datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp,
long us;
if (_PyTime_ObjectToTimeval(timestamp,
&timet, &us, _PyTime_ROUND_FLOOR) == -1)
&timet, &us, _PyTime_ROUND_HALF_UP) == -1)
return NULL;
return datetime_from_timet_and_us(cls, f, timet, (int)us, tzinfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment