GNOME Bugzilla – Bug 338463
Chats show UTC timestamps
Last modified: 2006-08-08 20:46:14 UTC
Please describe the problem: Timestamps in conversations as shown in UTC instead of local time. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Right you are Ralph :) I am not sure why we do this: can anyway tell me before I go changing it? Richard? Micke? Timestamps are created with: time_t t; struct tm *tm; t = time (NULL); tm = localtime (&t); Then tm is used with mktime - in UTC timezone: time_set_tz_utc (); t = mktime (tm); time_reset_tz ();
It's not showing UTC for me, it's showing my local time. The code snippet above is used because we are treating times -as if- they are UTC since it's a lot easier to get working with both localtime and the time stamp that arrives. Ralph, do you mean that the time stamps in the regular chat windows are shown as UTC for you? If you, has it always done it? And finally, is it in a *BSD system?
Yes, I mean the time stamps in the regular chat windows. I don't think it has always done this, but I'm not sure which version started having this problem. I'm using FreeBSD. I think I set that on this issue, but that field seems to have disappeared.
Created attachment 64275 [details] [review] Might help Could you please see if this helps?
Ralph can you see if this is ok for you before this weekend? I plan to do a release, I will include this if it fixes your problem.
Martyn, I don't see the point in closing the bugs like this. NEEDINFO is good for old bugs where there is no feedback and we really need some to go on. Ralph, do you think this has popped up recently or has it always been like that? I suspect that there is some difference in how the time code works on *BSD and Linux, it works fine for me.
I'm sure it has not always been like this, because I would certainly have reported it. I reported on another timestamp issue before. I tried the patch, but it resulted in not getting any timestamps at all. I talked to Martyn about this, and he was going to try out some things. What I'm wondering is why the playing with TZ? Can't you just use the system calls for dealing with times in different locales? E.g. gmtime(3) and localtime(3)?
I don't remember the exact reason for the hack, but it had to do with problems with differences between the timezone of incoming messages and the user's own timezone. IIRC it was more speficically due to problems to convert the timestamp from other users to localtime since the timezone handling isn't the same in all unixes. I guess it would be fairly easy to come up with a better way to do it. This code hasn't changed for a long time though so I don't know why it suddenly doesn't work for you. Switch to a real OS maybe? ;)
I've committed a change that fixes this at least on my Mac which is kind of freebsd-ish. Ralph, could you try as well please?
Marking this as fixed, Ralph, if you still have this problem, can you reopen please.