-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reports timezone is always in GMT #17
Comments
What is your php.ini What about the I have both |
Also I'll commit an addition to |
Take a look at this commit and see if it fixes your issue 4e76ac5 if it does then fix |
Sorry I just saw this. In php.ini, that was one of the first things I set: I'll incorporate your changes into my fork and see if that solves my issues and report back :-) |
While you're at it could you add an echo statement to the report your running:
and see if the timezone matches what you've selected. Oh and what do you have selected in |
https://drive.google.com/file/d/0B8rpAE3Gj5gZUThJNG94aWc4dkE/view?usp=sharing At the top left I have added a line in the header echoing the timezone for the reports. The timezone being used/picked up by the script is the same as in php.ini. Notice that the time the report was run is in PST, but all the user punches are in GMT. |
Sure, can do. I set use server timezone to yes (server is in my same time zone... it's only a few miles from me), and check this out: https://github.com/andrew867/timeclock/blob/master/functions.php#L304 Is not being set. $tzo is blank. Edit: Maybe I'm barking up the wrong tree here :-/ This is the code I'm using in header post reports:
|
Here is a screenshot of the info table: |
I remember having a lot of trouble in the past getting timezones working properly in timeclock. Here's a quick description of what happens:
Specific to your issue PHP might be compensating automatically then something related to |
But when I set it to no, the same thing happens. $tzo = 0 in both cases, yes and no on use server timezone. |
Ok, so this is fun stuff. It's working now, but I didn't change anything except use server timezone to 0. When I started having this trouble this morning, both client and server timezone settings were 0. The reports are still not using the offsets except for only the new punches. Apparently instead of performing the offset at time of display, it is performing the offset before writing to the database. I don't need to point out how fail this is. This means that any time you change your timezone, you completely screwed over your timeclock. Times should be written to the db as GMT and then the offset applied whenever written in a report or displayed. |
I agree, it's a pretty big bug. What should happen is the punch should be stored in GMT with another column specifying what timezone it was punched from (to keep it complete with the other changes I mentioned above). Also the |
Excellent point about the Timezone column and yes, I completely agree. I'm glad I understand what is actually going on now though. I really appreciate you time spent in helping me! :-D |
I've opened #18, #19, and #20 outlining the issues we just found and potential fixes. Feel free to assign them to yourself if you feel like fixing them. I had originally taken over timeclock as I was developing an Arduino based NFC timeclock to use at work to track my overtime, I should dig out my old code and publish it as it seems like you might be able to make use of it! |
I'll see what I can do, no promises. Unfortunately it's kind of becoming clear that I won't really be able to use this for work, which puts it in the hobby column. I'll see if I can't make some improvements to it though. It has potential, just needs a few extra kicks to get it headed in the right direction. |
Have a look at TimeTrex for your work, it's what I ended up using and seemed to work quite well. |
Where are you at currently with working on the time issues? Is there any insight you can provide on the issue other than what has been discussed already? I too was looking at this for work. When I noticed the time issues, I realized we couldn't use it. My company likes open source stuff so I have a time limit of 1 week to have this working or I have to move on. |
I finally settled on timeclockwizard.com It's extremely nice and completely web based. I didn't really like the idea behind timetrex. It looks nice, but it also looks like a pain to set up. |
For me changing the lines in leftmain worked fine. |
In functions.php, setTimeZone(), I added a new line 'global $tzo;' That did the trick for me. |
thanks for the fix, will give it a try On Sep 20, 2016 3:01 PM, "John" [email protected] wrote:
|
Confirming, This fixed my issue On Fri, Aug 12, 2016 at 11:53 AM, hjelmua [email protected] wrote:
|
I have a potentially serious blocking bug, and that is that reports ignore the local timezone and are always in GMT. Dealing with date/time functions in php is not one of my stronger areas and I really need some help in fixing it. Even with using the server time, and client offset time, time displayed on reports AND on the main home screen are always in GMT. I have checked the cookie and have verified that it has the correct offset (-480 GMT-8). This cookie seems to get sent/set regardless of the settings you have chosen.
Personally, I would prefer to have a timezone setting in the settings page where I could simply choose what timezone I wanted to use globally. I've looked into this but frankly I'm not sure how I would do it. For the moment I need this particular bug solved before I can invest tons of time into it.
The text was updated successfully, but these errors were encountered: