GNOME Bugzilla – Bug 98021
Bugzilla should use UTC time
Last modified: 2005-04-23 21:59:19 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.
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. :)
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.
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.
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.
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 on attachment 32456 [details] [review] Patch to replace localtime by gmtime Marking needs-work based upon my previous comment.
Maybe you could setup the machine timezone to UTC and the next reboot everything would be in 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.
Created attachment 45584 [details] [review] Patch to switch MySQL connection to 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).
Nobody was working with Bugzilla except me, made the change. All times are now in UTC. Marking FIXED.