I am working on an app that will export a calendar event to Google
Calendar. Google Calendar requires that event datetimes be in UTC
format. I can make the conversion from local (America/New_York) to UTC
using pytz, but the time is off by an hour due to daylight savings
time (Python thinks the offset is -0500 rather than -0400) so all of
my exported events are off as a result.

This is a Python "problem," not a Django one, but I'm hoping someone
else has dealt with this issue and come up with a solution.

I'm first taking the naive datetime stored by Django and adding the
local timezone pulled from settings.py then using astimezone(pytz.utc)
to make the conversion to UTC. I'm not sure how to adjust for DST,
especially since all the events will be in the future and DST will
have to be calculated for each of them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to