What I'm doing now is using dateutil module to convert value from
server's timezone to local time zone in my app on retrieval, but i'd
rather let MySQL manage this conversions.

from dateutil import tz
_tz_moscow = tz.gettz("Europe/Moscow") # local timezone
_tz_local = tz.tzlocal() # server systems timezone

def convert(dtime):
    return dtime.replace(tzinfo=_tz_local).astimezone(tz=_tz_moscow)

In fact MySQL TIMESTAMP column stores values in UTC, but this values
are retrieved in server time zone.

I don't have superuser privileges. Setting time zone per MySQL
connection is the only option for me.



-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to