I’m sending some dates from server that has it’s time in gmt-6 format, but when i convert them to isoformat i don’t get the tz designator at the end.
I’m currently setting the date like this:
date.isoformat()
but I’m getting this string: 2012-09-27T11:25:04 without the tz designator.
how can I do this?
You’re not getting the timezone designator because the
datetimeis not aware (ie, it doesn’t have atzinfo):In the past, when I’ve had to deal with an unaware
datetimewhich I know to represent a time in a particular timezone, I’ve simply appended the timezone:Or combine the approaches with: