How do I print a Python datetime in the local timezone?
- by mike
Let's say I have a variable t that's set to this:
datetime.datetime(2009, 7, 10, 18, 44, 59, 193982, tzinfo=<UTC>)
If I say str(t), i get:
'2009-07-10 18:44:59.193982+00:00'
How can I get a similar string, except printed in the local timezone rather than UTC?