I don't find anything to find the timezone from a PyDateTime_DateTime
. I want to get either the offset or the timezone name if possible.
Do you know how to do that ?
Thx
I don't find anything to find the timezone from a PyDateTime_DateTime
. I want to get either the offset or the timezone name if possible.
Do you know how to do that ?
Thx
There just isn't any C API accessor for a datetime's time zone. Your best option is to go through ordinary attribute access:
PyObject *tz_or_none = PyObject_GetAttrString(dt, "tzinfo");