Django Formatting Time

I am retrieving a timestamp from JSON that I want to convert to EST and format in a human-readable form.

When I extract it from JSON, I get the following text: "2012-06-30T10: 36: 06-07: 00"

How can I convert it to the east coast (+3 hours) and in the correct format ("6-30-2012 1:36 pm")?

+4
source share
1 answer

you can use the pyiso8601 package that does this for sure. It accepts tzinfo which you can use pytz to get predefined time zones. [they have a lot, for example.]

+1
source

All Articles