On 31 dec 2009, at 09:19, Thadeus Burgess wrote:

> Are dates stored in the database as UTC?

Should depend on database configuration (timezone settting) I presume.

> How do you convert the dates between UTC / locale ?

Use pytz (http://pypi.python.org/pypi/pytz/)

from datetime import datetime
import pytz
now = datetime.now(pytz.utc)
ams_tz = pytz.timezone('Europe/Amsterdam')
now_in_ams = now.astimezone(ams_tz)
print "utc: %s, ams: %s" % (now, now_in_ams)

See pytz docs for more info.

> Is request.now in UTC?

Just getting back at web2py programming and haven't got it fired up, but
that should be easy to verify for yourself, right?

-- 
Guido

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to