How to show local time (instead of UTC) in events-list?

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
User avatar
danielmalaga
Posts: 15
Joined: Sun Nov 07, 2021 12:09 pm
Location: Málaga, Spain
Contact:

How to show local time (instead of UTC) in events-list?

Post by danielmalaga »

Hi,

All videos are saved with the correct local time (UTC+2.00), also the inserted time in the snapshot pictures show the correct local time, but in the events list start/end-time show UTC time.

Where/how do I set that the local times are displayed?

(
ZM-options TIMEZONE is set to "(GMT+02:00) Europe, Madrid"; MySQL timezone is set the same
as said, ZM obviously knows the local time as it inserts the correct local time into snapshot images
I think it must be a display setting have I missed
)

Can you hint me in the right direction?
Thanks!
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: How to show local time (instead of UTC) in events-list?

Post by bbunge »

Best way to fix this is to add the timezone to php.ini

This example is for Debian 12

Add timezone to PHP (This may not be necessary but does not hurt and will allow the time of events to be displayed correctly)

nano /etc/php/8.2/apache2/php.ini

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

Ctrl+o Enter to save

CTRL+x to exit

Restart Apache

service apache2 restart
User avatar
danielmalaga
Posts: 15
Joined: Sun Nov 07, 2021 12:09 pm
Location: Málaga, Spain
Contact:

Re: How to show local time (instead of UTC) in events-list?

Post by danielmalaga »

SOLVED.

Thank you very much, bbunge!

Changing date.timezone in php.ini did the trick. Times are now displayed in my local time.
dougmccrary
Posts: 1314
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: How to show local time (instead of UTC) in events-list?

Post by dougmccrary »

Curious -
Did you not get a prompt at (initial) setup time to set Options->System->TIMEZONE?
User avatar
danielmalaga
Posts: 15
Joined: Sun Nov 07, 2021 12:09 pm
Location: Málaga, Spain
Contact:

Re: How to show local time (instead of UTC) in events-list?

Post by danielmalaga »

I am not sure if there was a prompt or if I set it up according to my old setup on my last install on another machine.

Anyway, Options->System->TIMEZONE is/was set correct, and this was not the problem. The problem was that in php.ini date.timezone was set to 'UTC' instead of 'Europe/Madrid' (in my case)
dougmccrary
Posts: 1314
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: How to show local time (instead of UTC) in events-list?

Post by dougmccrary »

Interesting.
Thanks.
Post Reply