プロジェクト

全般

プロフィール

Vote #75105

未完了

Wrong search query for timelog, when timezone not UTC

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Time tracking_13
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
13
version_id:
0
issue_org_id:
16482
author_id:
65970
assigned_to_id:
0
comments:
23
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
82
ステータス-->[New]

説明

How to reproduce:

  1. You are need to have server/devbox timezone set to UTC+X, where X is positive.
  2. At 00:30 I'm create a timelog entry.
  3. Right after this at a timelog reports page I'm select option to show only today timelog entries.
  4. After pressing the search button, I'm can't see the timelog entry.
  5. After the X time after 00:00, I'm can press the search button and can see the timelog entry as it need to be.

How to fix:

  1. Replace all Date.today to Time.zone.today.

Patch: WIP, writing tests, investigating side effects.


journals

I think I'm seeing the same issue manifesting itself in a slightly different way. The timezone on my Redmine server is set to UTC, and I've set @config.active_record.default_timezone@ to @:utc@ in config/enviroment.rb.

When I log work for local date 2014-10-01, but at a time when the UTC date is still 2014-09-30, attempting to view spent time where date is "today" doesn't return any results. Entering today's date rather than just "today" does return the correct records though.
--------------------------------------------------------------------------------
patch in #22320
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I think this issue is fixed by #22320, right?
--------------------------------------------------------------------------------
I'm afraid not.
We just upgraded to 3.3.2.stable from 3.1.2.stable and this issue just showed up.
This is still a problem.

Our server is set to GMT-5, and all date based queries done by users whose local time zone is set to GMT-6 through GMT-11 give incorrect days.
We have two workers in GMT-8 whose date based queries are not working.
Queries for tickets due "today" show tomorrow.
Changing the time zone to GMT-5 makes the issue disappear.

Environment:
Redmine version 3.3.2.stable
Ruby version 2.2.5-p319 (2016-04-26) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2

Please let me know if there are tests I can do that would help pinpoint the cause.

thanks,
--------------------------------------------------------------------------------
Example:
Server time zone GMT-5
User time zone set to GMT-8
Screenshot attached of query looking for tickets due 2/21/17, query returns tickets due 2/22/17.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Thank you for marking this as New, is there any other information that I can help provide for those who are able to fix this?
Does anyone know of a patch that I could apply in the meantime?

thanks,
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
We just upgraded to 3.3.3.stable from 3.3.2.stable and this issue persists.
--------------------------------------------------------------------------------
It seems to be a Rails bug:
https://github.com/rails/rails/issues/3145
https://github.com/rails/rails/issues/6816

I looked in the Redmine code and everything looks fine for me until this line: source:trunk/app/models/query.rb#L1295 which returns for the date _Mon, 20 Feb 2017 23:59:59 AKST -09:00_ the value _2017-02-21 08:59:59.999999_. I used "(GMT-09:00) Alaska" for user timezone and GMT-5 on the server to reproduce the issue.

From what I understand, the issue is fixed on Rails 5.
--------------------------------------------------------------------------------
Thank you!

It looks like Redmine doesn't support Rails 5 yet.
#23630

--------------------------------------------------------------------------------
Is there any way to fix this other than upgrading to Rails 5, which doesn't seem possible yet?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Thank you for relating this to the appropriate tickets.
That said, this is affecting the ability of our remote workers to effectively use redmine.
Does is appear there is anything we, as non-coders, could do other than wait for Redmine to support Rails 5?
It looks like #23630 is blocked by #19755 which looks pretty far down in the roadmap queue.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Thank you Toshi for linking my ticket with this one. Despite searching for quite I while I somehonw failed to find this.

Anyway, I'm having the exact same problem. In addition to time zone it also seems to be affected by language selected in "My account"...
--------------------------------------------------------------------------------
Hi there,

I just upgraded from 2.3.3 --> 3.4.3 (rails 4.2) -> latest version (rails 5.1) and this issue is still occurring, it does not appear to be an issue with Rails then. Any suggestions?
--------------------------------------------------------------------------------
This is still affecting the ability of our remote workers to effectively use redmine.
Thank you to those who have tested newer versions of rails.
To devs: is there more information that you would need from any of us in order to track down the cause of the bug?

--------------------------------------------------------------------------------
This is still happening on 4.1.6

It is particularly annoying when you try to generate a list of entries for 'this month' or 'between' dates when in the Western Hemisphere, for a team working in the Eastern Hemisphere. You end up with entries displaying a date that is one day after the date range you selected so you have to manually adjust the 'between' dates accordingly.

The problem is compounded when you have contractors working across far east and far west and a few spots in between. When you want to pay them based on their hours, you have to be careful to avoid either missing a day or paying for the same day twice (especially if you are in a different timezone at the time of generating the report!).

It would be great to display the applicable timezone being used for the report on this page, and IDEAL if you could choose to change it (or otherwise work around it by changing your own timezone in your profile).

Is there any point updating here or should it be on the NEW #23189? Since that is 5 years old and included a patch that hasn't been applied, I am not sure that would make a difference...

Thanks for an overall great Free product - other than reporting the issue and providing patches, how can we help resolve this?
--------------------------------------------------------------------------------


related_issues

relates,Closed,22320,Respect user's timezone when comparing / parsing Dates
relates,Closed,19033,Filters that utilize date/time ignore user's UTC offset
relates,New,23189,Spent time by filter, offset by one day
relates,Closed,23630,Migrate to Rails 5.2
duplicates,Closed,25822,'Spent time' report is timezone-dependent (which it should not)
duplicates,Closed,26156,Spent time not working correctly with user's zone different from system's time zone

Admin Redmine さんがほぼ2年前に更新

  • カテゴリTime tracking_13 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0