timezone settings

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Tantamount
Posts: 76
Joined: Wed Feb 03, 2016 7:51 am

timezone settings

Post by Tantamount »

Not sure what I broke -- recent recordings in the events folder are showing what I think is UTC dates, while zm expects to find the recordings using the timezone I've got configured.

Error:

Code: Select all

Event was not found at /var/cache/zoneminder/events/5/2022-04-03/101303. It is unlikely that playback will be possible.
Reason:
Local end time of event shows in the zm gui as 04/03/22 20:08:53, however in UTC, it would be one day ahead

Code: Select all

root@server-0:/var/cache/zoneminder/events/5/2022-04-04# ls -la 101303
total 19246
drwxr-xr-x  2 www-data www-data        3 Apr  4 03:09 .
drwxr-xr-x 56 www-data www-data       54 Apr  4 04:43 ..
-rw-rw-r--  1 www-data www-data 17055132 Apr  4 03:09 101303-video.mp4
I /think/ I've got the timezone settings correctly synced everywhere, and haven't made any changes to ZM, so I'm a bit perplexed why this would happen all of a sudden? Still running v1.36.12

mariadb docker container uses TZ environment variable:

Code: Select all

TZ=America/Los_Angeles
If I use the mysql client and 'select now()' it shows the time and date for that timezone.

and in the ZM database a query for the timezone settings correctly returns the same zone:
select Value from Config where Name= "ZM_TIMEZONE";

Code: Select all

+---------------------+
| Value               |
+---------------------+
| America/Los_Angeles |
+---------------------+

php.ini contents:

Code: Select all

[Date]
date.timezone = America/Los_Angeles
The events show the correct timezone in the gui, so ZM seems to know what's up, but oddly doesn't when it chooses to create the date folders?
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
dougmccrary
Posts: 1312
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: timezone settings

Post by dougmccrary »

You wouldn't have run windows on that, would you?
Otherwise, what's in options -> timezone? Probably LA, but...
Tantamount
Posts: 76
Joined: Wed Feb 03, 2016 7:51 am

Re: timezone settings

Post by Tantamount »

dougmccrary wrote: Mon Apr 04, 2022 8:42 am You wouldn't have run windows on that, would you?
Otherwise, what's in options -> timezone? Probably LA, but...
Screen Shot 2022-04-05 at 10.25.21 PM.png
Screen Shot 2022-04-05 at 10.25.21 PM.png (31.31 KiB) Viewed 1161 times
That should be the same value I mentioned above when I ran this on the sql server:

Code: Select all

select Value from Config where Name= "ZM_TIMEZONE";
Microsoft Windows is not in the picture at all. All of this runs in containers on linux nodes.
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: timezone settings

Post by Magic919 »

I expect nobody else is running ZM in K8S.
-
User avatar
iconnor
Posts: 3123
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: timezone settings

Post by iconnor »

Having a little trouble wrapping the problem in my head, but here's some thoughts:

The actual recording and timestamping are done in C++ land, using system time. So nothing to do with php. So the question is what is the system timezone set to? Sounds like it might be UTC, which is likely the default in a container... distros ask this when installing, but when auto spinning up a container.. they have to guess. So the thing to do would be to look at what the data command says from a command line in the container... and I don't know what's available for setting it. On a full system running systemd it would be sudo timedatectl set-timezone America/Los_Angeles

The php setting is to tell php what timezone you are in for constructing sql queries etc so that they match.
They all have to be in sync.
Post Reply