Setting computer clock to UTC = problem! (SOLVED)

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
caladeira
Posts: 64
Joined: Wed Dec 05, 2007 10:57 am
Location: Lisbon

Setting computer clock to UTC = problem! (SOLVED)

Post by caladeira »

Hello!

I'm using zoneminder for about 3 months now, and I�ve detected a small bug that has some impact on the user interface.

I�m using Ubuntu 7.10 server with zoneminder 1.22.3 installed from zoneminder_1.22.3-8_i386.deb, running ntp to adjust time.

When I�ve installed ubuntu, I�ve set the system clock to UTC as advised in most ubuntu setup guides.
However, since I�m in Portugal, my real time is UTC-1.

As a result of this setting (I think) the time information in the main zoneminder page is always in advance 1 hour (in the upper left corner).

The total for events by hour is always 0.
If I click on one of this �0�, I�ll get an empty list; however, if I change the filter from -1 hour to -2 hour, I�ll get the list of events from the last hour.

Besides this, all clock information is correct across all events.

Do I have to change the ubuntu clock setting to local time instead of UTC?
How can I do this after the system is installed?

I appreciate if anyone can give me a clue to solve this issue.

Best regards,
Carlos Ladeira
Last edited by caladeira on Thu Feb 07, 2008 12:17 am, edited 1 time in total.
haus
Posts: 213
Joined: Thu Oct 11, 2007 5:10 am

Post by haus »

There's a note here:

http://www.wikihow.com/Change-the-Timezone-in-Linux

that "Some applications (such as PHP) have separate timezone settings from the system timezone". Maybe that is what's at work here? I'm not sure how old that document is, though, vs. ubuntu 7.10.

From ubuntuforums.org (a fantastic resource):

sudo tzconfig

This supposedly allows you to change timezone settings. That's an interesting issue you've found. Implementing time zones on servers can be a bit complex because different people (and programs) expect different things. There's a perfectly valid argument for setting your server clock to UTC and then relying on programs to make the calculation of what time zone you are in, but personally, on a standalone ZM box I would just set the system time as the local time and be done with it.
KegRaider
Posts: 25
Joined: Mon Sep 05, 2005 5:06 am
Location: Townsville/Queensland/Australia

Post by KegRaider »

hi Caladeira,

have you found a solution yet? I have the same issue with my interface, yet, I have set my hwclock and system clock to the same, local time.

I have checked the wiki posted above, but still doesn't help i'm afraid. I think from what I read in the page, that PHP has a separate timezone which I'm yet to find.

I'm using the Mandriva LiveCD 1.22.3

Regards,

Troy.
User avatar
caladeira
Posts: 64
Joined: Wed Dec 05, 2007 10:57 am
Location: Lisbon

Post by caladeira »

Hi there!

I'm sorry but I've been away for some time.

This problem seams to be related with a bug in php.

If I find something, I'll post here.

Thanks.
User avatar
caladeira
Posts: 64
Joined: Wed Dec 05, 2007 10:57 am
Location: Lisbon

Post by caladeira »

Hello!

I've found a better way to correct this php problem related with the local time.

To fix it, edit the file "/etc/php5/apache2/php.ini", uncomment and set the line "date.timezone" to your time zone.

In my case I set this way:

date.timezone = Europe/Lisbon

Hope it help.
Locked