Reputation: 23
The issue I have is the following: When I display dates on the page, they show up 1 day less than what is stored on the database. How do I fix this issue?
Upvotes: 0
Views: 23
Reputation: 23
I noticed how the dates in the database are 1984-12-30 00:00:00 meaning its at the start of the 30th of December but for the Timezone that's +2. In the settings.py for my project I noticed the TimeZone is UTC (which is +0), meaning that that DateTime at UTC was actually 1984-12-30 22:00:00 (2 hours behind).
I fixed this issue by changing the TimeZone for my Django server to a +2 Timezone, so the dates are represented properly.
EDIT: typos
Upvotes: 1