[mythtv-users] Mythweb timezone question

Michael T. Dean mtdean at thirdcontact.com
Sat Nov 12 18:31:34 UTC 2011

On 11/12/2011 01:03 PM, Andrey Zhunev wrote:
> Saturday, November 12, 2011, 9:14:00 PM, you wrote:
>> On 11/12/2011 11:12 AM, Andrey Zhunev wrote:
>>> After recent daylight saving time switch, I'm having an issue with
>>> MythWeb time being one hour earlier than it should be.
>> What do you mean by this?
> Here's an example:
> Current actual time is 21:28 (or 09:28PM).
> In the upper right corner of MythWeb, I can see the time is 20:28.
> The "TV listings" are off by 1 hour, too - according to MythWeb, the
> next show is to start at 20:30 (in 2 minutes from now), while it
> will actually start at 21:30 (which is the 2 minutes from now).
> "Recorded Programs" are shifted by 1 hour as well. A show I recorded
> today from 17:00 to 18:00 (actual time) is displayed in MythWeb as
> recorded from 16:00 to 17:00.

If the times are correct on the master backend and frontends running on 
that host, it means that the zone data files for PHP differ from those 
for your system.  That means you need to update PHP to get newer zone data.

>>> date.timezone = Etc/GMT+4
>> You almost certainly don't want this one--you want:
>> date.timezone = Europe/Moscow
>> although Etc/GMT+4 has the same time right this minute as as
>> Europe/Moscow, they have had different times over the years.  Using
>> Etc/GMT+4 (and such) is basically equivalent to just setting your clock
>> to local time--which will break MythTV because MythTV needs to know the
>> current time offset /and/ the offset for every point in the past (since
>> you started using MythTV) and in the future (for as long as you continue
>> to use MythTV).
> Our lovely government recently decided that we (Russia) should not
> switch to/from daylight saving time anymore. Instead, we are
> permanently staying on summer time, which is GMT+4. So from now on, we
> are fixed to GMT+4 (until they decide on something else).
> While Linux timezone data is easily updated by means of tzdata file,
> I couldn't find an easy way to update php with recent timezone
> changes.

Yeah, that's almost definitely the problem, then.

>   I'm pretty sure my php version doesn't know what our
> government decided - so I thought I would just tell it to stick to
> "Etc/GMT+4". The only drawback that I see is that my old recordings'
> start and end times could appear shifted in MythWeb. I can live with
> that.

It would actually cause some other problems--not just display problems. 
  Some recordings wouldn't be found, and MythWeb would request 
screenshots for non-existent recordings, which would result in tons of 
bad requests to the backend, which would result in tons of errors in 
your logs.  And, those recordings wouldn't be available through MythWeb. 
  Recording rules may not be created and/or deleted properly, and lots 
of other problems I haven't thought of would likely result.

>> That said, MythWeb requests the current time zone from the master
>> backend system and then applies whatever time zone is set on the master
>> backend (because the important thing is that all MythTV hosts agree on
>> the rules for applying offsets, not just on the current offset).
>> Therefore, date.timezone isn't used (unless you're using a really old
>> MythTV).
> I have mythbackend, apache http server and mythfrontend running on the
> same machine. I'm accessing mythweb from another machine (I guess it
> shouldn't matter, but this machine's timezone is also set to GMT+4).
> The time is correct everywhere, except for Mythweb - as I explained
> above...

The easiest way to update PHP's time zone information would probably be 
to update PHP to a current version (assuming the current version has the 
updated zone data--not sure how recently it changed).  There's also a 
note at http://us2.php.net/manual/en/timezones.php that says, "Note: The 
latest version of the timezone database can be installed via PECL's » 
timezonedb." (and provides a link for, "a drop-in replacement for the 
builtin timezone database that comes with PHP").  It's also available at 
http://pecl.php.net/package/timezonedb .  See, also, 
http://us3.php.net/manual/en/install.pecl.php .


More information about the mythtv-users mailing list