On Apr 14, 9:34 pm, Brian Neal <bgn...@gmail.com> wrote:
> This is how I am doing it (I'm also integrating with Google Calendar):
<snip>
> tz = pytz.timezone(tz_name)  # create timezone
> local = tz.localize(d)  # make naive datetime localized
> zulu = local.astimezone(FixedOffset(0))  # convert to UTC
> s = zulu.strftime('%Y-%m-%dT%H:%M:%S.000Z')

tz.localize() did the trick.

I was using naive_datetime.replace(tzinfo = tz) to convert from naive
to a localized time. Once I changed that to tz.localize
(naive_datetime), it worked perfectly.

Thanks for the help!
--~--~---------~--~----~------------~-------~--~----~
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