• Victor Stinner's avatar
    Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods · 511491ad
    Victor Stinner yazdı
    of datetime.datetime: microseconds are now rounded to nearest with ties going
    to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
    zero (ROUND_DOWN). It's important that these methods use the same rounding
    mode than datetime.timedelta to keep the property:
    
       (datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)
    
    It also the rounding mode used by round(float) for example.
    
    Add more unit tests on the rounding mode in test_datetime.
    511491ad
Adı
Son kayıt (commit)
Son güncelleme
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
Tools Loading commit data...
.bzrignore Loading commit data...
.gitignore Loading commit data...
.hgeol Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
.hgtouch Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
aclocal.m4 Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...