This question already has an answer here:
I'm sure this must be answered somewhere, but I can't find it.
How do I print the current local date/time in ISO 8601 format, including the local timezone info?
eg: 2007-04-05T12:30-02:00
In particular (and this is the difference to the other question) - how do I get the local timezone?
Note, I'm stuck at Python 2.5, which may reduce some availability of options.
Usually this is done via
isoformat
. It should be available in Python 2.5.which yields:
If you have correct UTC offsets in your
tzinfo
this should be rendered aswell.