﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29204	Problems with Django and timezone	ovalseven8	nobody	"First of all my settings.py:

{{{
LANGUAGE_CODE = 'de-DE'

TIME_ZONE = 'Europe/Berlin'

USE_I18N = True

USE_L10N = True

USE_TZ = True
}}}

Also, I have a model with one DateTimeField:

{{{
from django.utils import timezone

class CustomModel(models.Model):
   time = models.DateTimeField(default=timezone.now, editable=False)
}}}

However, I have a problem in my admin: It's ~ 22:00 now (my local time). When I create an instance of CustomModel, it looks so in the admin page:
[[Image(https://i.imgur.com/GGUuCsZ.png)]]

You can see the inconsistency? **I do not know if the time is saved correctly because it's 22:00 in my time zone.**

Now look, if I change my CustomModel:

{{{
class CustomModel(models.Model):
    time = models.DateTimeField(auto_now_add=True)
}}}

The admin page looks so now (no inconsistencies anymore!). **However, it's 22:12 in my time zone now.**
[[Image(https://i.imgur.com/H4IV0e5.png)]]

So there is definitely a bug somewhere.

Anyway, I have a question:
What should I do, is the time saved correctly and only the display wrong?"	Uncategorized	closed	Uncategorized	2.0	Normal	invalid			Unreviewed	0	0	0	0	0	0
