mysql's timezone does not match the system timezone!

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
krizzle
Posts: 19
Joined: Tue Oct 30, 2018 6:07 pm

mysql's timezone does not match the system timezone!

Post by krizzle »

Hello,
I recently installed Zoneminder 1.36.14 onto Ubuntu Server 20.04. I followed IConnors video here - https://www.youtube.com/watch?v=RhBsW8HkOG4
After the install I noticed that the timestamp on the videos and the time recorded in the event lists were incorrect. I used

Code: Select all

sudo timedatectl set-timezone <your_time_zone>
to configure the timezone to my location. After doing so the timestamp was correct but the times within the event list were still in UTC time. The log also showed an alert which read "ZoneMinder is not configured properly: mysql's timezone does not match the system timezone! Event lists will display incorrect times." Can anyone help me configure the timezone within mysql so the times match within my setup? Any help is appreciated.

Thanks.
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: mysql's timezone does not match the system timezone!

Post by bbunge »

That wonderful YouTube video aside there are easier install instructions in the ZM WIKI here: https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.36.x

AS for the timezone issue, your time is likely coming from the php.ini. There is a setting in there to change the timezone but you can also set it in Zoneminder Options - System - Timezone.

Or:
Add timezone to PHP

nano /etc/php/7.X/apache2/php.ini (Note: replace 7.X with your version of PHP)

Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone

[Date]

Defines the default timezone used by the date functions
http://php.net/date.timezone

date.timezone = America/New_York
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: mysql's timezone does not match the system timezone!

Post by Magic919 »

MySQL will follow the system TZ unless you specify otherwise. Make sufre you restart the DB after you set the system TZ.
-
Post Reply