gadss
gadss

Reputation: 22489

python and django timezone didn't match

when i datetime my python i got the exact timezone in my country.

>>> import datetime
>>> now = datetime.datetime.now()
>>> str(now)
'2012-02-03 16:21:29.898276'

but when i datetime my python django shell, i got this:

>>> import datetime
>>> now = datetime.datetime.now()
>>> str(now)
'2012-02-03 02:22:44.740254'

how can i configure django python to get the exact timezone in my country?

thanks in advance ...

Upvotes: 1

Views: 530

Answers (1)

shadyabhi
shadyabhi

Reputation: 17234

Check your settings.py for the TIME_ZONE settings.

The available choices can be seen here. Edit accordingly in your settings.py (can be found in the project root)

Upvotes: 3

Related Questions