I have a Django API/PostgreSql project, where i try to store the datetime in UTC format, which later i will convert to a correct timezone in the front end with angular.
My current settings are:
USE_TZ = True
TIME_ZONE = 'US/Eastern'
I was first using UTC, but for some reason the datetime was stored as +1 hour, so i set the time zone to my servers time zone
Model:
date = models.DateTimeField(default = timezone.now())
But still when i retrieve the inserted record, the time is -3 minutes late.
While when i use the code bellow, it stores a correct time:
date = models.DateTimeField(auto_now_add=True)
Am i missing something in the configuration ? What TIME_ZONE should i use, server location time_zone, or it has to do with the servers time setup ?