Last Comment Bug 646209 - Bugzilla doesn't offer UTC timezone
: Bugzilla doesn't offer UTC timezone
Status: VERIFIED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: User Accounts (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Bugzilla 4.0
Assigned To: Tom Dickson
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-29 14:26 PDT by Tom Dickson
Modified: 2011-04-28 14:29 PDT (History)
2 users (show)
mkanat: approval+
mkanat: approval4.0+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Minor patch to force UTC to be available (410 bytes, patch)
2011-03-29 14:27 PDT, Tom Dickson
mkanat: review+
Details | Diff | Splinter Review

Description Tom Dickson 2011-03-29 14:26:32 PDT
User-Agent:       Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.27 (KHTML, like Gecko) Ubuntu/10.04 Chromium/12.0.717.0 Chrome/12.0.717.0 Safari/534.27
Build Identifier: 4.0

If you go to user preferences, you can't select UTC as the timezone you want to see.

Reproducible: Always

Steps to Reproduce:
1. Edit user or site preferences, cannot pick UTC

Actual Results:  
You should be able to pick UTC, so you can work around bug 452353.

Expected Results:  
I got a list of timezones, but UTC was not among them.

I suspect it is because the DateTime::TimeZone->all_names call doesn't return all names, and especially doesn't include UTC.
Comment 1 Tom Dickson 2011-03-29 14:27:59 PDT
Created attachment 522801 [details] [diff] [review]
Minor patch to force UTC to be available

Here is my current workaround; I force 'UTC' to be added to the end of the list when the preferences are displayed.

It works and allows me to select UTC and see the times in UTC even though the server time is PST.
Comment 2 Frédéric Buclin 2011-03-29 14:35:19 PDT
As for other similiar requests [1], the list of timezones comes from DateTime::TimeZone. Artificially adding UTC to the list won't help. It should be added to DateTime::TimeZone itself to make it work correctly.

[1] https://bugzilla.mozilla.org/buglist.cgi?quicksearch=INV+prod%3ABugzilla+summary%3Atimezone
Comment 3 Max Kanat-Alexander 2011-03-29 14:43:16 PDT
Are you saying that some DateTime versions return UTC on some systems, and others don't? Because we should definitely have UTC as a choice, no matter what DateTime does.
Comment 4 Tom Dickson 2011-03-29 14:50:35 PDT
My version of DateTime (1.19) doesn't have UTC in the list of "all_names" but does have things that link to it. 1.22 and 1.31 (latest) don't have it either.

It appears they do list SOME three-letter times, but we specifically grep them out:


    # Remove old formats, such as CST6CDT, EST, EST5EDT.
    @timezones = grep { $_ =~ m#.+/.+#} @timezones;

So even if DateTime returned UTC (it doesn't) we'd not see it.
Comment 5 Tom Dickson 2011-03-29 14:56:21 PDT
I've posted adding UTC to DateTime::TimeZone:

https://rt.cpan.org/Public/Bug/Display.html?id=67070
Comment 6 Max Kanat-Alexander 2011-03-29 22:13:07 PDT
Comment on attachment 522801 [details] [diff] [review]
Minor patch to force UTC to be available

Looks good to me.
Comment 7 Tom Dickson 2011-04-04 15:41:43 PDT
Can someone commit this for me? According to https://wiki.mozilla.org/Bugzilla:Developers I should do it but I'm not a committer.
Comment 8 Max Kanat-Alexander 2011-04-04 17:08:12 PDT
Sure. Thanks for the bug report and the patch! :-)

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/User/Setting/Timezone.pm
Committed revision 7771.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/                         
modified Bugzilla/User/Setting/Timezone.pm
Committed revision 7569.
Comment 9 Tom Dickson 2011-04-28 14:29:12 PDT
This is working after an upgrade to 4.0.1.

Note You need to log in before you can comment on or make changes to this bug.