I was thinking of the values you would ultimately store in the database and
what you might use them for eventually. If you want to use these times in a
SQL expression in the WHERE clause through direct SQL or through DAL
expressions and search across multiple users for something created between
2011/5/21 pbreit pbreitenb...@gmail.com:
This is the best answer I've seen:
http://stackoverflow.com/questions/117514/how-do-i-use-timezones-with-a-datetime-object-in-python
It can get complicated so make sure you need it.
i thought i would be easy when I read massimo saying something about
2011/5/19 danto web2py.n...@gmail.com:
I'm setting the created_on field in a database table with request.now
but i need to adjust the result to my timezone with the application
(it's a shared server). Can you tell me how can I achieve this?
thank you in advance
kind regards
sorry, it's
Actually it isn't that obvious. In Python the datetime class by default is
not time zone aware. If you have users coming from multiple time zones the
best universal way to handle this is store the time in UTC which the
datetime class has a method for datetime.utcnow(). This is how UNIX does it
This is the best answer I've seen:
http://stackoverflow.com/questions/117514/how-do-i-use-timezones-with-a-datetime-object-in-python
It can get complicated so make sure you need it.
5 matches
Mail list logo