3

Since the update to Stack Overflow, I noticed that when I hover my username at the top, it shows a new box, and in that box at the bottom, it says UTC time [time].

The thing is that the time represented there is the time on my computer. And my computer's clock is wrong, so the "UTC" time is also wrong!

So... Should't it be using the server's time and translate it to UTC?

6
  • Could it be that your computer's wrong time just happens to be UTC time? I've got it looking correct on my machine.
    – Grace Note StaffMod
    Commented Mar 14, 2011 at 16:01
  • Aha, I figured it was sent in the HTML source by the server, but it is indeed updated using JavaScript (when leaving the popup open).
    – Arjan
    Commented Mar 14, 2011 at 16:07
  • @Arjen - are you saying it is displaying "local UTC" time? Something wrong with that :) Commented Mar 14, 2011 at 17:02
  • Yes, @Hans, I guess it is. Which yields, like the OP states, the wrong time if the local clock is set incorrectly, or if the local time zone is incorrect. (One can see the server time on page load at the bottom of meta.stackoverflow.com/users/recent @jack, how much difference do you see between that time and the time in the popup?)
    – Arjan
    Commented Mar 14, 2011 at 17:17
  • 1
    UTC time seems correct when comparing it to my system's clock. Commented Mar 14, 2011 at 18:06
  • 1
    I've just made a simple test: Changed the time on my computer and without even reloading this page the popup updated to the new time, so it is indeed getting the local time, at least on my mac, safari 4.
    – jackJoe
    Commented Mar 14, 2011 at 18:24

1 Answer 1

4

In the next build there's an offset detection on page load, meaning we compare server time to your local time when the page loads and use that offset to (very closely) display server-time in the popup, rather than strictly your local time as UTC.

If you change your time while the page is open...well that's a bit unreasonable, you're still on your own there :)

8
  • nice one; I just changed the time while the page was open for test purposes :)
    – jackJoe
    Commented Mar 14, 2011 at 18:35
  • You are doing this for all the UTC times you display? Think tooltips. Commented Mar 14, 2011 at 21:39
  • @Hans - specifically for the profile clock, all other times are already rendered in the HTML directly. Commented Mar 14, 2011 at 22:20
  • So if the user's machine is off, the profile clock won't match any of the other times you display. Just rendering the profile clock in HTML solves that. The user's machine is off, you are not. It is not your problem. Commented Mar 14, 2011 at 22:33
  • @Hans - The profile popup clock updates ;) The offset that went in will render the correct UTC time regardless of how far off the user's local time is...that's why we calculate the offset. Commented Mar 14, 2011 at 22:47
  • Any chance this could also be used for "asked xx minutes ago"? (To avoid problems like Time shown incorrectly and Indicator changes to “2 hours ago” no matter when it was actually posted.)
    – Arjan
    Commented Jul 2, 2013 at 17:55
  • 1
    @Arjan indeed it can be - I pushed a JS change in the last few builds that should resolve it - asked the OP of the latest question and am awaiting confirmation on it working. Commented Jul 2, 2013 at 21:58
  • @NickCraver This still affects the real-time network questions (I set my time to be 1 minute fast, and all new questions are "active 1 minute ago": i.sstatic.net/nM6Tj.png
    – Tim
    Commented Jul 12, 2015 at 14:09

You must log in to answer this question.

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