I use Django 3 + Bootstrap 4 + MySQL 5.7 on a Laragon server, all on Windows 10.
My setting in Django : TIME_ZONE = 'Europe/Paris'
My setting in MySQL : TIME_ZONE = SYSTEM
(My system is configured with 'Europe/Paris')
When I use a timezone.now()
in Django, or a CURRENT_TIMESTAMP
in MySQL, I have no problem, the right time is displayed.
But my data imported from MySQL are displayed wrongly: with a +2 hours error.
For what I have read on the subject, the cause can be the absence of data in MySQL time_zone
table, on the server.
What's your point of view ? Am I on the good track ?
I don't want to make a mistake, so I prefer to have a confirmation first.
And do you think it's good to keep the setting so in MySQL. Shouldn't I prefer
TIME_ZONE = 'Europe/Paris'
instead of TIME_ZONE = SYSTEM
?