On Thu, 2006-05-25 at 18:52 +0000, Eduardo P=C3=A9rez wrote:
> I strongly suggest to not save the timezone at all and keep every
> date/time on disk in UTC and show these timestamps localized to the
> timezone and timeformat for the user.
No. You clearly do not understand what is supposed to happen here.
We used to save logs without a timezone. They were saved in local time.
We then displayed them in local time. Now, for example, if you normally
reside in Minnesota and then you go to the UK, all your old logs will
show has having timestamps in GMT/BST, which is completely bogus. The
desired effect is that they continue to be displayed in CST/CDT, while
new logs show in GMT/BST. When you fly back to the US and reset your TZ,
nothing should change with the old logs.
Also, the logs should sort in the order the conversations actually took
place in, not the numerical sorting of localtime. This is really only an
issue if you cross a timezone boundary and lose an hour of local time in
less than an hour of elapsed travel time... or whatever. To achieve
this, you need to store the offset.
Off the top of my head, I don't know if I use the offset for anything
else, but it's good to have, since it allows you to convert to GMT if
you want it.
Storing the times in GMT breaks backwards compatibility more than is
necessary. No matter how you slice it, you need to know either a
localtime and an offset or GMT and an offset. Neither is really "better"
than the other for this purpose (because you can calculate either from
the other). That's why we still write them in local time.
The TZ abbreviation is stored for display purposes. Otherwise, given
that you have a conversation that's GMT-0500, you have no idea if that's
CDT or EST or something else.
Anyway, time zone math makes my head hurt. The current solution works
properly under every case I've ever experience and all of them I could
think of to test.
The bug that Nathan saw was a win32 code refactoring mistake. It's been
long fixed in SVN, and since it's just a display issue (as opposed to a
file naming issue), once you upgrade, all your old logs display as they