Page 1 of 1

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

Posted: Tue Jul 25, 2023 9:42 am
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!

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

Posted: Wed Jul 26, 2023 1:01 am
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

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

Posted: Wed Jul 26, 2023 8:53 am
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.

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

Posted: Wed Jul 26, 2023 9:14 am
by dougmccrary
Curious -
Did you not get a prompt at (initial) setup time to set Options->System->TIMEZONE?

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

Posted: Wed Jul 26, 2023 9:35 am
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)

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

Posted: Wed Jul 26, 2023 9:51 am
by dougmccrary
Interesting.
Thanks.

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

Posted: Wed Dec 11, 2024 9:04 am
by anndrew
Thank you, it worked for me too (currently using Zoneminder 1.36.35 under Debian 12-bookworm as well).
For those who - like me - might miss the final lines of the solution message, don't forget to restart apache2 for the change to take effect, for example like this:

Code: Select all

sudo systemctl restart apache2