-
Notifications
You must be signed in to change notification settings - Fork 11
189 #191
base: master
Are you sure you want to change the base?
189 #191
Conversation
Time should always be stored in UTC. From this patch it appears time is not being stored in UTC. |
Somewhere we went wrong, I think we should create new column for datetime timezone field to store timezone and convert the datetime to UTC. While displaying convert UTC to respective timezone. Alembic migration need to address existing data. Does that sound right ? |
Dates should always be stored in UTC. We used to do that earlier. Can you Kiran Kiran Jonnalagadda (Sent from my phone)
|
I looked into DB. jsFoo 2012 hacknight start time is 12.00PM (http://hacknight.in/jsfoo/2012#/participants). DB Value Same for other events. What user enters is not what user sees. Looking into the commits of |
So the form edit isn't setting timezone. You have to set |
Yes, / |
Now |
|
||
|
||
@app.template_filter('weekdate') | ||
def weekdate(date): | ||
return utc.localize(date).astimezone(app.config['tz']).strftime("%a, %b %e") | ||
return utc.localize(date).strftime("%a, %b %e") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is can't be right. If the date is stored in UTC, you need to convert to the correct timezone when displaying or it will display in UTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, something is still wrong, converting to tz
puts back same behaviour.
Fixed #189 . This error was due double parsing of time field, one during form rendering and another in template filter.