mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-04-10 13:30:17 +00:00
int() truncates towards zero, so for pre-epoch datetimes with non-zero microseconds the seconds component gets the wrong value. For example, datetime(1969, 12, 31, 23, 59, 59, 500000, UTC) has timestamp -0.5, but int(-0.5) == 0, producing Timestamp(0, 500000000) (+0.5s after epoch) instead of Timestamp(-1, 500000000) (-0.5s before epoch). Use floor division (// 1) instead, consistent with from_unix(). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _cmsgpack.pyx | ||
| _packer.pyx | ||
| _unpacker.pyx | ||
| exceptions.py | ||
| ext.py | ||
| fallback.py | ||
| pack.h | ||
| pack_template.h | ||
| sysdep.h | ||
| unpack.h | ||
| unpack_container_header.h | ||
| unpack_define.h | ||
| unpack_template.h | ||