Quantcast
Channel: Python Django Time Zone Conversion Incorrect Time for 'US/Pacific' Time Zone - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Python Django Time Zone Conversion Incorrect Time for 'US/Pacific' Time Zone

$
0
0

While I read just about every post related to timezone conversions I'm still having some issues and my converted time is incorrect

settings.py

TIME_ZONE = 'UTC'USE_TZ = True

views.py

utc = datetime.utcnow()instance_time_zone = pytz.timezone(instance.timezone) # 'US/Pacific'start_date = instance_time_zone.localize(datetime.utcnow(), is_dst=None)

template.html

utc: Oct. 2, 2015, 5:32 p.m. #correct timestart_date: Oct. 3, 2015, 1:32 a.m. #incorrect time

For some reason, the converted time is wrong and 15 hours ahead of the Pacific Time and 8 hours ahead of the UTC time.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images