Spent time by filter, offset by one day
We just upgrade to 3.3.0.stable.
If you log time today (June28) and then go in spent time, filter by today, the logged time isn't showing up. If you do yesterday, it shows up with the today's date (June28).
Same issue in the project time logs.
However, if you select All, it works.
I tried to see if someone else had reported it, I couldn't find it, if it's the case I'm sorry in advance.
Updated by Jean-Philippe Lang over 7 years ago
This is related to #22320. Date filters now take care of timezones.
Workaround: I get correct results if I set the time zone in my account to the one used on the server.
Did you get incorrect results when leaving your timezone blank in your Redmine account?
Updated by Phlip Plumlee over 5 years ago
We have this bug, with version 3.4.2.stable.
On our server, with the UTC timezone, the Query system generates SQL that seems to compare a date by time adjusted by the timezone in my preferences (PST):
time_entries.spent_on >= '2018-01-09 07:59:59.999999' AND time_entries.spent_on <= '2018-01-10 07:59:59.999999'. I'm trying for January 9th, there, and MySQL presumably converts a date of '2018-01-09' to a datetime of "midnight".
On my notebook, set to PST, the query is correct:
time_entries.spent_on > '2018-01-14 23:59:59.999999' AND time_entries.spent_on <= '2018-01-15 23:59:59.999999'. I get the records I'm looking for, on '2018-01-15'.
When I erase my timezone from my Preferences on the server, the problem goes away.
I could fix this myself, as soon as I figure out where in the Query system that line gets generated...
Updated by Steve Karrmann over 5 years ago
We encountered this issue as well. Date filters were returning results off by one day, but only for users with a time zone specified in their account settings.
Our solution was to disable the time zone handling in class
date_for_user_time_zone - see attached patch.
With this change, all date filters return the correct dates, even for users with a time zone specified.