connortechnology / ZoneMinder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
9 stars 9 forks source link

Can't insert frames: Incorrect datetime value #43

Closed shaun-ba closed 6 years ago

shaun-ba commented 6 years ago

Logs:

2017-10-23 13:10:55.397484 zma_m3   17225 ERR Can't insert frames: Incorrect datetime value: '1970-01-01 00:00:00' for column 'TimeStamp' at row 10, sql was (insert into Frames ( EventId, FrameId, TimeStamp, Delta ) values ( 34, 1, from_unixtime(1508760651), 0.00 ), ( 34, 2, from_unixtime(1508760651), 0.04 ), ( 34, 3, from_unixtime(1508760651), 0.12 ), ( 34, 4, from_unixtime(1508760652), 0.25 ), ( 34, 5, from_unixtime(1508760652), 0.26 ), ( 34, 6, from_unixtime(1508760652), 0.34 ), ( 34, 7, from_unixtime(1508760652), 0.43 ), ( 34, 8, from_unixtime(1508760652), 0.46 ), ( 34, 9, from_unixtime(1508760652), 0.51 ), ( 34, 10, from_unixtime(0), -5522098.23 ))
shaun-ba commented 6 years ago

mysql> SELECT @@global.time_zone -> ; +--------------------+ | @@global.time_zone | +--------------------+ | SYSTEM | +--------------------+

mysql -uroot -p -e "SELECT NOW();" Enter password: +---------------------+ | NOW() | +---------------------+ | 2017-10-23 12:15:44 | +---------------------+

shaun-ba commented 6 years ago

This was solved by matching SYSTEM timezone to PHP timezone