Alexander Belopolsky added the comment: Victor,
Would you consider going back to round to nearest? Mark and I put in a lot of effort to get the rounding in the datetime module right. (See for example, #8860.) Sub-microsecond timesources are still rare and users who work with such should avoid FP timestamps in any case. On the other hand, double precision timestamps are adequate for microsecond resolution now and in the next few decades. Timestamps like OP's (sec=1424817268, us=274000) should not change when converted to double and back. IMO, the following behavior is a bug. >>> dt = datetime(2015, 2, 24, 22, 34, 28, 274000) >>> datetime.utcfromtimestamp(dt.timestamp()) datetime.datetime(2015, 2, 25, 3, 34, 28, 273999) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23517> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com