After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 98021 - Bugzilla should use UTC time
Bugzilla should use UTC time
Status: RESOLVED FIXED
Product: bugzilla.gnome.org
Classification: Infrastructure
Component: general
unspecified
Other All
: Low enhancement
: ---
Assigned To: Bugzilla Maintainers
Bugzilla Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-11-08 14:47 UTC by Christian Rose
Modified: 2005-04-23 21:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to replace localtime by gmtime (3.27 KB, patch)
2004-10-10 16:54 UTC, Sven Herzberg
needs-work Details | Review
Patch to switch MySQL connection to UTC (1.13 KB, patch)
2005-04-23 14:07 UTC, Olav Vitters
none Details | Review
Script to update the existing times on b.g.o (1.83 KB, patch)
2005-04-23 14:10 UTC, Olav Vitters
none Details | Review

Description Christian Rose 2002-11-08 14:47:06 UTC
It would be great if bugzilla.gnome.org as the bug tracker of a big
international project could use UTC time in all its timestamps. This would
help international collaboration.

There are several benefits:
* All timezones around the world are relative to the UTC and defined to be
a difference with regards to UTC. A user living in a particular timezone is
more likely to easily know about his time zone's difference to UTC than the
difference to any other random time zone around the world, such as the one
the bugzilla should happen to be in.
Also, using the difference to UTC is a much easier mental computation than
having to use both the user's own difference to UTC and the bugzilla's and
having to use both to compute the actual local time.

* UTC is not affected by daylight savings time. This means that timestamps
are valid all year. Thus, with bugzilla using UTC, all the user needs to
know is his own time zone's use of daylight savings time, and not also the
one of the time zone the bugzilla happens to be in, when it occurs etc.
Comment 1 Luis Villa 2002-12-03 19:54:43 UTC
Taking patches. Given that time is basically irrelevant to bug work
(order of comments matters, but that's not affected by time zone), I
can't bring myself to care much at all about this. Sorry. :)
Comment 2 Sven Herzberg 2004-10-10 16:54:39 UTC
Created attachment 32456 [details] [review]
Patch to replace localtime by gmtime

Well as I'm not a big fan of perl, I just needed to guess the reason for the
timezone stuff. I found the use of localtime [1] and after some gooling i found
the gmtime [2] should be the function to replace localtime.

[1] http://iis1.cps.unizar.es/Oreilly/perl/prog/ch03_088.htm
[2] http://iis1.cps.unizar.es/Oreilly/perl/prog/ch03_070.htm

So here goes my patch.

Someone please add the PATCH keyword, test it and check it in.
Comment 3 Danielle Madeley 2005-01-18 18:51:52 UTC
Luis, it's a pain because if you're trying to solve possibly time dependant bugs
(like those pertaining to weather forecast parsing) you have to know what the
current offset is for Bugzilla. Regardless of the fact that noone could reach a
consensus as to what that offset was, it would be easier if it was UTC, because
it's significantly less math.

If people were feeling hard core, we could implement a setting so that users
could set their timezone, and then display the time in local time next to the
UTC time, just like Evolution.
Comment 4 Sven Herzberg 2005-01-31 18:11:03 UTC
Fixing this might result in funny (read: non-chronological) orders of bugs and
bug comments unless we have a downtime of about 6 hours. Alternatively just
block bugzilla, convert ALL the timestamps by a script and run the new one with
the fixed time stuff.
Comment 5 Olav Vitters 2005-01-31 20:27:46 UTC
The patch is not enough. When a comment is added to MySQL, Bugzilla uses NOW()
in a lot of places to fill in the current date/time. NOW() returns the date/time
in the local timezone.
MySQL has UTC_TIMESTAMP that returns the date/time in UTC, but that is only
available as of 4.1.1. B.g.o runs MySQL 3.23.58.

Another way would be to change the MySQL local timezone to UTC. As described in
http://dev.mysql.com/doc/mysql/en/time-zone-support.html the only way to change
that in this version is to use either:
a. --timezone= option to safe_mysqld / mysqld_safe
b. set the TZ option

The database server is also used by artweb and lxr, so this would also mean
downtime for them. I'll ask gnome-sysadmin if they would be willing to change
the MySQL timezone.
Comment 6 Olav Vitters 2005-02-28 18:22:31 UTC
Comment on attachment 32456 [details] [review]
Patch to replace localtime by gmtime

Marking needs-work based upon my previous comment.
Comment 7 Eduardo Pérez Ureta 2005-03-24 09:51:29 UTC
Maybe you could setup the machine timezone to UTC and the next reboot everything
would be in UTC.
Comment 8 Olav Vitters 2005-04-08 15:41:48 UTC
Regarding comment 7: Thanks for thinking with me, but no that wouldn't work.
First of all MySQL doesn't store the old timezone, so those times have to be
updated. Second only the MySQL timezone would had to be changed with 3.23,
switching the entire server wasn't needed.

We're switching to MySQL 4.1, so this will be much easier. I can set the
timezone MySQL will use when Bugzilla establishes its database connection. This
should be a small change, but I want to perform some testing first.
Comment 9 Olav Vitters 2005-04-23 14:07:47 UTC
Created attachment 45584 [details] [review]
Patch to switch MySQL connection to UTC
Comment 10 Olav Vitters 2005-04-23 14:10:57 UTC
Created attachment 45585 [details] [review]
Script to update the existing times on b.g.o

Unfortunately I can't use locking.. a MySQL bug prevents me to do that. I'll
have to schedule some downtime to make the switch. Also Halloween needs to be
updated, but I can ignore the time set by Halloween (use gmtime in
bug-buddy-import.pl).
Comment 11 Olav Vitters 2005-04-23 21:59:19 UTC
Nobody was working with Bugzilla except me, made the change. All times are now
in UTC.

Marking FIXED.