﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
11447	Daylight Savings Time transition broken	Tom Grigg <tomegrigg@…>	Raymond Wagner	"The POSIX timezone implementation in the MythTV python bindings does not properly handle the transition to summer (daylight savings) time, which occurs here in the USA this coming weekend.

This is caused by scanning the transition table using the local time entry, which for the transition to DST is actually one hour ahead of the time for which the transition is being looked up.

A symptom of this issue is that attempting to convert a datetime instance from UTC to local time during the transition and the hour following will result in an incorrect result.  For example:
{{{
#!python
     starttime = datetime.duck('2013-03-10T10:30:00Z')  
     print starttime.astimezone(datetime.localTZ())
}}}
will print 
{{{
#!python
     2013-03-10 02:30:00-08:00
}}}
instead of 
{{{
#!python
     2013-03-10 03:30:00-07:00
}}}

Attached is a testcase and a quick and dirty patch which fixes the issue. It may be more elegant to implement a fix as the zoneinfo tables are read rather than during transition search."	Bug Report - General	closed	minor	0.27	Bindings - Python	0.26-fixes	medium	fixed			0
