Is Django application affected by the server timezone?

57 Views Asked by At

I have the below settings:

TIME_ZONE = UTC
USE_TZ = True

My server timezone is UTC+1 and the end user's timezone is UTC+2. Should I care about the server timezone or it is not related at all?

1

There are 1 best solutions below

0
Gracen Ownby On

Server time zone isn't related in most cases. Your application will use UTC. The most common application in python uses datetime.datetime.now(tzInfo=None) which will automatically pass tzInfo as None when you call datetime.datetime.now() . Unless you specify what timezone tzInfo is, the datetime object will always return UTC.