[mythtv-users] Can't playback recorded shows but preview works - SOLVED

Mike Holden mythtv at mikeholden.org
Fri May 9 10:16:46 UTC 2008

Michael T. Dean wrote:
> Myth doesn't currently support running multiple parts of the system
> configured with different time zones.  Feel free to write a patch, but
> you'll have to touch nearly every part of Myth (including, even,
> MythWeb).  And, it's possible that the patch won't be accepted as it
> makes interpretation of the data (for a human--i.e. for a dev
> investigating a bug report) much more complex.
> What you can't see on that patch is the /very/ long discussion I had on
> IRC with David Shay and Rob Smith after posting the patch where we
> figured out that the implementation I posted was not sufficient for our
> needs.  Rather than simply knowing what time zone a system is in, we
> need to know the rules that govern the time zone (i.e. a zoneinfo
> database ID).  Therefore, I'm rewriting the patch (and it's much more
> involved than the one currently on the ticket).

The "usual" method for dealing with multiple timezones and databases is to
accept a date/time from a user (or other source, xmltv in this case),
convert it from "local" time (relevant to that client's location) to UTC
and store it in the database. All calculations are then performed using
date/time data in UTC. Whenever a date/time needs to be displayed to the
user, then a conversion from UTC to the client's TZ is performed.

The crucial aspect is that all dates are stored and processed in a common
TZ, typically UTC (but could be any other TZ, another common choice is the
TZ of the "server", the master BE here). This means that the only time you
need TZ info is when converting dates from one TZ to another (at input or
output only), and there are Posix etc programming APIs to do this for you,
so you don't need to worry about the mechanics of it, or storing
conversion tables etc.

Of course, if the system wasn't designed that way in the first place, then
retro-fitting TZ manuipulation is a total mess, and will need changes all
over the place.
Mike Holden

http://www.by-ang.com - the place to shop for all manner of hand crafted
items, including Jewellery, Greetings Cards and Gifts

More information about the mythtv-users mailing list