Time is one hour off

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Time is one hour off

Post by poopa »

Time on machine running timetrex is correct but when punch in/out its one hour ahead.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

What timezone do you have selected in your MyAccount -> Preferences. As well, which database are you using?
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

All the users have the one hour gap problem.
All users use Asia/Jerusalem Time Zone.
Using MySql.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I'm not sure, does Asia/Jerusalem timezone recognize daylight saving time?

If so, your MySQL timezone database may be out of date, or incorrect. You may want to upgrade it, instructions to do so are here:

http://forums.timetrex.com/viewtopic.php?t=40
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

I dont know what you mean by recognize daylight saving time.
I downloaded the latest timezone support as described in this post
http://forums.timetrex.com/viewtopic.php?t=40
It didnt do any change.
our timezone is GMT +2 which should be the same as Jerusalem.
any other suggestions?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you change timezones, to GMT+0 for instance are the times correct if they happened in that timezone? Or are they off by an hour there too?

When using MySQL timezone issues are almost certainly caused by MySQL itself, all TimeTrex does is pass the timezone on to MySQL so it can do the conversions.

Try running these two queries at your MySQL console:

Code: Select all

set session time_zone="Asia/Jerusalem";
select now();
Is the time displayed correct?
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

The time displayed when running this command is incorrect
its 1 hour greater than real time.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Okay, so either you have selected the incorrect time zone, or your timezone database in MySQL is incorrect.


Have you downloaded the latest timezone tables described here:
http://forums.timetrex.com/viewtopic.php?t=40

If that doesn't fix the issue, then I would suggest finding a different timezone that better fits what you are looking for.
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

I have downloaded the latest timezone tables
didnt help
It seems that when I change the time zone in a user prefs it does not change the clock time when i check in/out
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Which other timezones have you tried? Have you tried using the Etc/GMT+2 timezone?

Are you getting any error messages appearing at the top of the pages in TimeTrex?

What version of TimeTrex are you running?
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

I have used gmt+2 gmt+4 gmt-2 gmt-10
none of them had any effect.
the version is 1.4.3
Would it help if I give a username?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Try these commands are your MySQL console:
select now();
set session time_zone="Etc/GMT+2";
select now();
Does that return the expected time?

This is what it looks like on our test server here:
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2007-05-02 08:37:27 |
+---------------------+
1 row in set (0.03 sec)

mysql> set session time_zone="Etc/GMT+2";
Query OK, 0 rows affected (0.30 sec)

mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2007-05-02 13:37:30 |
+---------------------+
1 row in set (0.00 sec)
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

thats weird
after running
set session time_zone="Etc/GMT+2";
select now();
I get 4 hours difference from the real time
when I set to GMT-2 i get the real time although its not my timezone
in any case
when clocking in/out i still get 1 our later
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Okay, so the MySQL timezones are working at least. I would try upgrading to v1.6.4 and see if that fixes your issue, or at least allows you to change timezones.
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

What I dont understand is why it happened suddenly.
It worked fine up until now.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I'm not sure, I know in North America the daylight savings time was all changed, and that causes some timezones to adjust themselves by one hour on a specific date.

If you were using a timezone that observes DST, that is probably what happened. However Etc/GMT* timezones do not observer DST that I am aware of, so its hard to say.

If your servers timezone was changed, that could cause the problem as well.

If you go into a new MySQL console and run:

select now();

Is the time correct?
poopa
Posts: 57
Joined: Tue Dec 05, 2006 7:02 am

Post by poopa »

Install a fresh new everything with latest versions
still get 1 hour off with my timezone but when change to GMT -2 (which is not my timezone) the time is correct.

any suggestions?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If I go to http://www.timezoneconverter.com (or http://www.timezoneconverter.com/cgi-bi ... /Jerusalem) and convert from GMT to Asia/Jerusalem I get GMT+3 and DST is in effect.

So that seems to explain the one hour difference that you all of a sudden started to see. Perhaps you don't observe DST where you are located? If thats the case then you will need to try a different timezone.

It all comes down to selecting the proper timezone that works for you, and since the timezones are all handled by MySQL, that determines what each timezone actually does.
Locked