[mythtv-users] python bindings and timezones

Stephen Robertson stephengrobertson at gmail.com
Sun Dec 30 11:17:54 UTC 2012


>> Well that's certainly odd.  I'll take a look into that...
>>
> I've been stumbling around and bit and thought I would share what I have found.
>
> In dt.py (line195)
> offset = -(time.timezone, time.altzone)[time.daylight]
> seems to be where the hour comes from.offset here is set to
> -3600(seconds)  changing it to
> offset = -(time.timezone, time.altzone)[0] and running my test code
> gives time values as I expect and lets me delete recordings.
>
> I'm not quite sure how to interpret that line.  Is it trying to
> establish whether we are in daylight savings time and work out what
> offset to use?  Or is it saying, what's the offset to use if I later
> decide that we are in daylight savings?
>
> If it is the former then it doesn't quite work as time.daylight
> indicates whether there is a DST timezone defined rather than whether
> it is active.  Though thinking about that some more it's not likely
> that is the case as this would only tell us if we were currently in
> DST rather than was DST in force at the time we are manipulating.
>
> As I say, I've been stumbling around so this is probably of no
> relevance but I thought I would share in case it pointed you towards
> anything.
>
> Cheers
> Stephen

Just to report back that
http://code.mythtv.org/cgit/mythtv/commit/?id=4dd0bf8014bf8261c8ed347517ef8197ac7f942e
certainly seems to solve this for me.

Thanks
Stephen


More information about the mythtv-users mailing list