mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
Have unpacked datetime timezone being local
This commit is contained in:
parent
19b5d33ded
commit
3715b72d57
2 changed files with 5 additions and 2 deletions
|
|
@ -355,10 +355,12 @@ static int unpack_callback_ext(unpack_user* u, const char* base, const char* pos
|
|||
return -1;
|
||||
}
|
||||
|
||||
py = PyNumber_Add(epoch, d);
|
||||
PyObject *added = PyNumber_Add(epoch, d);
|
||||
py = PyObject_CallMethod(added, "astimezone", "O", Py_None);
|
||||
|
||||
Py_DECREF(epoch);
|
||||
Py_DECREF(d);
|
||||
Py_DECREF(added);
|
||||
}
|
||||
else { // float
|
||||
PyObject *a = PyFloat_FromDouble((double)ts.tv_nsec);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue