diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-12-11 23:48:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 23:48:16 +0900 |
commit | 2186455d1579affc33253484d9445f7bdf3f7c29 (patch) | |
tree | 4081e93d9815fb0a63a81e9d3a55b1f971b02ac6 /msgpack/_cmsgpack.pyx | |
parent | 5fd611909319d03200774ea3c7a6ae16dbd26c12 (diff) | |
download | msgpack-python-2186455d1579affc33253484d9445f7bdf3f7c29.tar.gz |
Support datetime. (#394)
Diffstat (limited to 'msgpack/_cmsgpack.pyx')
-rw-r--r-- | msgpack/_cmsgpack.pyx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/msgpack/_cmsgpack.pyx b/msgpack/_cmsgpack.pyx index 8ebdbf5..1faaac3 100644 --- a/msgpack/_cmsgpack.pyx +++ b/msgpack/_cmsgpack.pyx @@ -1,4 +1,11 @@ # coding: utf-8 #cython: embedsignature=True, c_string_encoding=ascii, language_level=3 +from cpython.datetime cimport import_datetime, datetime_new +import_datetime() + +import datetime +cdef object utc = datetime.timezone.utc +cdef object epoch = datetime_new(1970, 1, 1, 0, 0, 0, 0, tz=utc) + include "_packer.pyx" include "_unpacker.pyx" |