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
Render last modification (and other) dates in local time zone #194
Comments
|
Problem is that the _render_date method may add "UTC" to the rendered date. Might need yet another option to _render_date $utc/$local. (note to self, for testing: $ENV{TZ} = "Pacific/Kiritimati" in session_init) |
|
Duplicate of #174 |
|
I discovered a problem with my above patch. The module Time::Local used by EPrints (timegm_nocheck) is trying too hard for its own good and will interpret "1940" passed to it by the caller in form of "40" to mean "2040". I see no easy workaround for that behavior - EPrints could pass through the year unmodified, and it would help in the considered case, but then years <1000 would still be misinterpreted. |
|
Here is my workaround (in perl_lib/EPrints/Time.pm, in _render_date, around line 422). |
|
@sebastfr, why was this issue closed? One of our users reported a wrong time for the "last status change" a few days ago. Obviously the time is always shown in UTC which is not what users expect: either it should be converted to the local time zone (maybe a user setting is needed for this) or there should be an indication that the time is UTC (adding that string would be sufficient). |
|
Thanks for answering. I noticed that there are two issues for the same problem, and both were closed. |
|
I have tested the fix that @GFournie posted above and it is displaying the dates/times correctly. This is a pretty annoying issue for those of us that are in timezones far away from UTC. We are in Australia in UTC+10, so things that were added through a script at 4am this morning is showing as being added at 6pm last night. |
Currently the "Last modification" date and other dates are displayed as they are stored in the database - in UTC time zone. It would be more sensible to render them in server's local time zone instead (our users complained about it).
Looking at documentation of EPrints::Time::render_date, it seems that it was intended so, but the implementation doesn't match spec. I suggest the following patch:
The text was updated successfully, but these errors were encountered: