dealing with “MySQL backend does not support timezone-aware datetimes”

When fetching events from an iCal feed and saving this into a database I got

MySQL backend does not support timezone-aware datetimes

This did the trick for me:

Install pytz (download here)

PYTHON:
  1. import pytz
  2. that_datetime_in_utc.astimezone(pytz.timezone('Europe/Zurich')).replace(tzinfo=None)

Caution: I don't really understand what I'm writing here - I feels like all those posts in PHP forums I saw about 'how to ...' and then someone trying to explain something he has no clue of, but well.. :-)

Leave a Reply