In settings.py
I have:
TIME_ZONE = 'Asia/Singapore'
USE_I18N = True
USE_L10N = True
USE_TZ = True
If a user (who is living in Singapore) enters 2013-10-07 01:00 A.M.
in a form on my site, the value stored in my (PostgreSQL) database is 2013-10-07 01:00:00+08
. When I pull up this information during a python manage.py shell
session, I get 2013-10-06 17:00:00+00:00
. The same happens when I try to render this information in a template.
What I think is happening: Django recognizes that the user is entering 1:00 A.M. on October 10th, Singapore time, and stores this in the database as 2013-10-07 01:00:00+08
. However, when Django retrieves this info from the database, it formats it to UTC time, thereby giving 2013-10-06 17:00:00+00:00
.
Do I have that right? And if so, what can I do to make Django display times using the same timezone information that is stored in the database (or at least using my TIME_ZONE
setting)? In other words, how can I make it so that the user sees the datetime in the exact same form as she entered it?