Annoying TZ Problem

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
rip
Posts: 24
Joined: Sun Sep 02, 2012 8:59 pm

Annoying TZ Problem

Post by rip » Thu Jun 13, 2019 11:59 pm

I finally rebuilt my ZM machine after a long time on 1.29.x

Now on 19.04 and 1.32.3 and it MOSTLY works fine, but I have an annoying issue when I click on the console screen, total events for the last hour, I'm apparently 7 or so hours ahead on the timeline. (Nothing displays, if I click TIMELINE, I see an empty timeline in the future.)

If I zoom out and back, events do exist and play at their correct position on the timeline in local time.
Just opening the timeline is in the future for me (apparently UTC, right now I'm UTC -7 so if I do timeline from the last hour [say at 12:00 noon] I'll get a an empty timeline around 7PM. If I arrow back to noon, my events are there at their correct time.)

MY TIMEZONES ARE CORRECT, system time is correct, php.ini is correct, etc. I suspect there is an offset snuck in to the DB itself. (like, I may have initially fired up the DB or copied the DB in while in UTC time.)

I suspect it will work itself out as events get purged, but I have a lot of space With many terabytes of storage it may take weeks for the first purges to hit organically.

Is there a graceful way to iron this out?

I haven't looked deeply into it, but figured I could modify the purge script to kill at 10% full and run it manually and see what happens.

Plan B would be nuke the DB and configure again, (but rather not, already have a lot of tuning done, just ironing out one RTSP H264 smearing problem (getting better).)

Thanks for your ideas!

kitkat
Posts: 84
Joined: Sun Jan 27, 2019 5:17 pm

Re: Annoying TZ Problem

Post by kitkat » Fri Jun 14, 2019 7:59 pm

You've probably done it, but double check your php.ini - I'm pretty sure I read that at least one of the installers adds a date/time setting at the end.

rip
Posts: 24
Joined: Sun Sep 02, 2012 8:59 pm

Re: Annoying TZ Problem

Post by rip » Tue Jun 18, 2019 9:38 pm

Thanks. I went back and found that somehow UTC *DID* get appended to the end of the file, so I did have it correct but if I went to the last line in the apache php.ini there was a second date.timezone line. Serves me right for being lazy and not scrolling down to the 1939th line. :wink:

Code: Select all

$ cat /etc/php/7.2/apache2/php.ini |grep timezone
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Los_Angeles
date.timezone = Etc/UTC

bbunge
Posts: 2435
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Annoying TZ Problem

Post by bbunge » Wed Jun 19, 2019 12:12 pm

kitkat wrote:
Fri Jun 14, 2019 7:59 pm
You've probably done it, but double check your php.ini - I'm pretty sure I read that at least one of the installers adds a date/time setting at the end.
You are correct. If you use one of my install shell scripts from the WIKI, the date.timezone setting is appended to the php.ini based on the contents of /etc/timezone. If you change the system timezone settings you have to manually change php.ini. I did this to make things easier for most folks. bb

rip
Posts: 24
Joined: Sun Sep 02, 2012 8:59 pm

Re: Annoying TZ Problem

Post by rip » Thu Jun 20, 2019 6:19 am

Thanks again.

As an afterthought, you could use SED and a little black magic to uncomment the original php.ini date.timezone line and insert the value from /etc/timezone...though >> is easier. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests