0

In django 1.5,

i used in my settings... :

USE_TZ = True 
TIME_ZONE = 'Europe/Paris' 

when i created an objects with

date_crea= auto_add_now()

at 16h20 on my computer in Paris, on the mysql database, date_crea is set to 14h20 ...

On my admin list_display, i see 16h20 too but when i want to used date_crea in my view, my_objects.date_crea=14h20, why django know to show me the correct date on my admin list_display and not in my view ?

Rohan
  • 52,392
  • 12
  • 90
  • 87
laurent
  • 660
  • 2
  • 8
  • 19
  • I have the same problem. `TIME_ZONE = 'Europe'` solve my problem, but this is not correct timezone from the list. So i'm still looking for solution. – Petroff Jul 07 '14 at 14:51
  • Can you post little more about your view code? Like the actual view.py and then the template code. – Juho Rutila Jul 07 '14 at 18:45

2 Answers2

0

In Django 3.0.5

change the variable "USE_TZ = True" to "USE_TZ = False". That will work

Matrix
  • 1
  • 1
-2

TIME_ZONE = 'UTC' is the solution.

obayhan
  • 1,636
  • 18
  • 35