Got stuck at a point in Django.
I have stored a value in my PostgreSQL db in the
TIME_ZONE = 'Asia/Kolkata'
format, but when I fetch the same from Django, it gets converted into UTC.
Example:
I have a timeline field in my table in postgres with a stored value of 2015-05-02 05:29:59+05:30
When I fetch it from django shell it gives datetime.datetime(2015, 5, 1, 23, 59, 59, tzinfo=UTC)
Kindly assist. Do I need to change any settings in Django? My current settings are:
TIME_ZONE = 'Asia/Kolkata'
USE_I18N = True
USE_L10N = True
USE_TZ = True
Apart from this , tzlocal is giving desired timezone value
>>> from tzlocal import get_localzone
>>> get_localzone()
<DstTzInfo 'Asia/Kolkata' LMT+5:53:00 STD>