What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Just curious as to what the reasoning behind making the time stamps for the questions and answers in UTC instead of localizing the time for the client.

I do realize it's easier to store the value in UTC. But, I would guess most of us think in local time and showing the date and time of the post isn't as meaningful if it's in UTC, having to do a conversion each time we see it.

I think it would be more useful and intuitive if it showed "answered Jul 2 at 15:38 EST" where EST is the viewer's local time zone.

It's possible I'm just not Skeet enough to think in Coordinated Universal Time. (Skeet is an adjective as well as a verb, right?)


EDIT: As noted by me and others, perhaps defaulting to UTC, but allowing a user to select a different timezone in their profile would be a reasonable request.

share|improve this question
    
Did not find possible duplicates when viewing the suggested list when typing the question. While this is more of a "why" question... there is a localization request here: meta.stackexchange.com/questions/1359/… To continue the "meta" theme... is it most appropriate to click "delete" now that I've found this? –  Feckmore Jul 6 '09 at 21:15
    
Since this question can really only be answered by the dev team, and since there's already a feature request for local times, then I would recommend deleting this post and continuing the discussion there. –  Kyle Cronin Jul 6 '09 at 21:20
    
@Kyle: Is it worth me porting my answer over there, do you think? –  Jon Skeet Jul 6 '09 at 21:25
    
@Kyle: does your advice still stand after an answer is given. I'm still learning the culture of SO and MSO. –  Feckmore Jul 6 '09 at 21:38
    
@Traples: I'm still getting the hang of Meta myself. I'm not going to force this closed or anything, but if you want, I can merge the answers here into that feature request. It would destroy this question, so I leave it up to you. –  Kyle Cronin Jul 6 '09 at 23:12

2 Answers 2

up vote 3 down vote accepted

I agree with Traples, w/ exceptions for feasibility:

  • Store in database in UTC
  • compute all statistics (daily point totals, limits, etc.) in UTC
  • convert times for display as date/time to local time
    • local timezone defaults to UTC
    • local timezone can be set by user on user's account page
share|improve this answer

Do you really want users to bother filling in their time zone? JavaScript can guess what offset you happen to be at right now, but that's not a good indication for any other point in time. Then you'll get users who have seen the right information until recently, but things have gone wrong for them because it had autodetected their settings and got the wrong actual location, etc. (1)

Then you have to make sure the server always has up-to-date time zone information, which isn't as easy as it might sound (depending on exactly what you're doing).

It's definitely feasible - especially if it's just a case of representing a UTC instant as a local time - but I'd personally rather see everything in UTC completely, rather than have the "7 mins ago" stuff.

(It wouldn't have been nearly as easy pre-.NET 3.5, by the way.)

As someone who has to deal with time zones all the time, I'd advise Jeff and the team to stay away from them unless they really, really have to handle them. (It's possible that StackExchange will have to do this, as there'll be more local deployments I suspect.)


(1) At least we could get away with a single time zone setting on SO. When trying to provide support to ActiveSync users on iPhones, I have to ask users for four different time zone settings - two on Google Calendar and two on the iPhone. Madness.

share|improve this answer
1  
1) user's filling in the time zone could be optional... if they choose to, they would see their local time zone, if not they see UTC. 2) I thought I was kidding with the "not Skeet enough" remark. I'm amazed that even you would prefer to read a UTC time to "17 minutes ago." I'm guessing you might be in the minority here. That's just a guess. –  Feckmore Jul 6 '09 at 21:35
2  
Not to be picky, but it's a lot easier for someone living in the UK to say "I'd personally rather see everything in UTC completely, rather than have the "7 mins ago" stuff" than someone living in, let's say, New Zealand. As for "you'll get users who have seen the right information until recently, but things have gone wrong for them because it had autodetected their settings and got the wrong actual location, etc.": they should just default the user's timezone preference to UTC, then no one will notice any change unless they set that preference. –  Kip Jul 6 '09 at 21:46
    
True... although New Zealand might not be the best example, as that's relatively easy to get right: 6am => 6pm etc :) –  Jon Skeet Jul 6 '09 at 21:57
    
@Traples: If it gives a UTC date/time, then I don't have to guess how much difference there really was between two answers both marked "6 hours ago". –  Jon Skeet Jul 6 '09 at 21:57
2  
"As someone who has to deal with time zones all the time, I'd advise Jeff and the team to stay away from them" -- That's good enough for me! –  Jeff Atwood Jul 7 '09 at 8:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .