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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With