Naive datetime warning when Django time zone support is enabled #13

Closed
trungdong opened this Issue Jul 11, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@trungdong
Owner

trungdong commented Jul 11, 2013

Warning by Django 1.5.1:

site-packages/django/db/models/fields/init.py:827: RuntimeWarning: DateTimeField received a naive datetime (2013-07-04 00:00:00) while time zone support is active.

@jdcourcol

This comment has been minimized.

Show comment Hide comment
@jdcourcol

jdcourcol Oct 29, 2013

Contributor

Hi,
I noticed that the timezone is lost when looking at the database content, for instance : 2013-10-03T10:59:59.743+02:00
is stored as 2013-10-03T10:59:59.743000 .
Is that related to that issue too ?

I tried with dateutil.parser instead and the date is stored with the timezone.
(http://stackoverflow.com/questions/969285/how-do-i-translate-a-iso-8601-datetime-string-into-a-python-datetime-object)

Is there any reason for not storing the timezone ?

Contributor

jdcourcol commented Oct 29, 2013

Hi,
I noticed that the timezone is lost when looking at the database content, for instance : 2013-10-03T10:59:59.743+02:00
is stored as 2013-10-03T10:59:59.743000 .
Is that related to that issue too ?

I tried with dateutil.parser instead and the date is stored with the timezone.
(http://stackoverflow.com/questions/969285/how-do-i-translate-a-iso-8601-datetime-string-into-a-python-datetime-object)

Is there any reason for not storing the timezone ?

@trungdong

This comment has been minimized.

Show comment Hide comment
@trungdong

trungdong Jul 29, 2014

Owner

No longer applies.

Owner

trungdong commented Jul 29, 2014

No longer applies.

@trungdong trungdong closed this Jul 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment