Mythweb using wrong time/timezone [Solved]
Moderator: Forum Moderators
Mythweb using wrong time/timezone [Solved]
I'm having trouble with getting mythweb to show the correct time/timezone. I'm in EDT but in mythweb (mythtv 0.28 on Ubuntu 16.04), the displayed time is 3hr off. I'm presuming that mythweb thinks the correct timezone is PDT. I read in some old posts that mythweb (pre 0.28) automatically grabs the system timezone but that has not happened over the last few days. I assume that is still the case, but that is not apparently happening in my system. The hardware time (as shown in BIOS) is the correct UTC time and the linux system clock has been set and confirmed ('data +%Z' + 'hwclock -r') to be the correct timezone and shows the current time.
The system is a fresh install of Ubuntu 16.04 with a follow-up installation of mythtv 0.28 + mythweb (upgrading from mythtv 0.27). But I had not noticed until a few days later that mythweb was showing the wrong time by 3 hours. I checked the linux system clock, and sure enough, it showed PDT instead of the proper EDT, so I corrected it. But since then, mythweb has not updated it's knowledge of time. In mythweb, the program guide and "Recorded Programs" stilll shows all everything in with 3 hr offset (seemingly PDT). On the other hand, the various frontends (remote and local to backend) all show the corrent EDT times in both the program guide and recording times. And the backend is starting/ending all recordings at the correct time.
I've now waited 2+ days for mythweb to correct itself, since I corrected the backend system timezone for mythweb. I've restarted the server multiple times, dpkg-reconfigure mythweb several times, and have purged and reinstalled mythweb several times...over the last couple of days....all to no avail.
Can some please help me figure out what is going on with mythweb? I might be willing to live with the problem, but mythweb is also not letting me schedule any recordings (it complains about 'Incorrect datetime value') and I'm wondering if it might have something to do with the timezone.
EDIT (7/24): I injected the "date_default_timezone_get" command into the mythweb.php code and it reports the correct "America/NewYork" timezone.
Thanks
The system is a fresh install of Ubuntu 16.04 with a follow-up installation of mythtv 0.28 + mythweb (upgrading from mythtv 0.27). But I had not noticed until a few days later that mythweb was showing the wrong time by 3 hours. I checked the linux system clock, and sure enough, it showed PDT instead of the proper EDT, so I corrected it. But since then, mythweb has not updated it's knowledge of time. In mythweb, the program guide and "Recorded Programs" stilll shows all everything in with 3 hr offset (seemingly PDT). On the other hand, the various frontends (remote and local to backend) all show the corrent EDT times in both the program guide and recording times. And the backend is starting/ending all recordings at the correct time.
I've now waited 2+ days for mythweb to correct itself, since I corrected the backend system timezone for mythweb. I've restarted the server multiple times, dpkg-reconfigure mythweb several times, and have purged and reinstalled mythweb several times...over the last couple of days....all to no avail.
Can some please help me figure out what is going on with mythweb? I might be willing to live with the problem, but mythweb is also not letting me schedule any recordings (it complains about 'Incorrect datetime value') and I'm wondering if it might have something to do with the timezone.
EDIT (7/24): I injected the "date_default_timezone_get" command into the mythweb.php code and it reports the correct "America/NewYork" timezone.
Thanks
Last edited by kmpatel on Sun Jul 24, 2016 11:51 am, edited 1 time in total.
Re: Mythweb using wrong time/timezone
Help! Please! Anyone?
Re: Mythweb using wrong time/timezone
Hi,
No idea why. I Googled: mythweb timezone and got some results. that may help.
Or, with 0.28, go to: yourBackendHostnameOrIP:6544. That's WebFrontend and
you can schedule programs from it (at least 'til you get mythweb your real question
answered.)
No idea why. I Googled: mythweb timezone and got some results. that may help.
Or, with 0.28, go to: yourBackendHostnameOrIP:6544. That's WebFrontend and
you can schedule programs from it (at least 'til you get mythweb your real question
answered.)
Re: Mythweb using wrong time/timezone
I'd check the timezone setting for your php installation. Should be under /etc/php or similar
Re: Mythweb using wrong time/timezone [solved?]
I found a fix to the problem. I cannot explain the underlying cause of the problem, but I debugged and found a hack to fix the problem.
I found that at onset of the execution of 'mythweb.php' script, PHP uses the correct system timezone. But somewhere in the execution of the initialization script 'include/init.php', the timezone is change to the wrong one (i.e. PST). The specific line that causes the problem is "MythBackend::find()->setTimezone();", near the end of init.php. I don't know how THAT line works (i.e. where it gets the timezone info) but my quick fix was simply to comment that line out. Now Mythweb works the correct system timezone without any other detrimental effects.
I found that at onset of the execution of 'mythweb.php' script, PHP uses the correct system timezone. But somewhere in the execution of the initialization script 'include/init.php', the timezone is change to the wrong one (i.e. PST). The specific line that causes the problem is "MythBackend::find()->setTimezone();", near the end of init.php. I don't know how THAT line works (i.e. where it gets the timezone info) but my quick fix was simply to comment that line out. Now Mythweb works the correct system timezone without any other detrimental effects.
Re: Mythweb using wrong time/timezone
For posterity, I experienced the same issue, and it was caused by stale data in the mythweb_sessions table. Truncating the table and refreshing solved the problem.
Code: Select all
mysql -umythtv -p mythconverg -e 'TRUNCATE TABLE mythweb_sessions;'
Re: Mythweb using wrong time/timezone
Worked perfectly!!! Thanks
Re: Mythweb using wrong time/timezone [Solved]
Your solution worked Deuce!... Thank You!!
.. I am not sure I ever would have found on my own
.. I am not sure I ever would have found on my own
Re: Mythweb using wrong time/timezone [solved?]
I have to resort to this for correcting the timezone on Ubuntu PPA/mythtv-0.29. Is there a better fix?kmpatel wrote: ↑Wed Dec 14, 2016 2:50 amI found a fix to the problem. I cannot explain the underlying cause of the problem, but I debugged and found a hack to fix the problem.
I found that at onset of the execution of 'mythweb.php' script, PHP uses the correct system timezone. But somewhere in the execution of the initialization script 'include/init.php', the timezone is change to the wrong one (i.e. PST). The specific line that causes the problem is "MythBackend::find()->setTimezone();", near the end of init.php. I don't know how THAT line works (i.e. where it gets the timezone info) but my quick fix was simply to comment that line out. Now Mythweb works the correct system timezone without any other detrimental effects.