# Stack Exchange sites need a universal clock that is visible!

Since the Stack Exchange sites run on one clock, and a clock that is not common to most of us (such as those of us in the US), can we display a clock with the site time (UTC) displayed somewhere on every page, such as at the bottom with the other text? That way we are more aware of when the days turn over, and ecetera...

close votes, delete votes, flags, and normal votes would also benefit from this as well (thanks @Grace Note!)...

What do you guys think? yea or nay? thoughts?

-
you can already mouseover recent comments to get their UTC timestamp. That's what I use. If you haven't made any recent comments, I can't see why you care when rollover happens :) –  Philip Potter Aug 31 '10 at 0:19
@Philip Potter: I care, for reasons listed in @George Edison's post and, I want to know! :-) –  studiohack Aug 31 '10 at 0:21
Why do timezones confuse people so much? –  Rebecca Chernoff Aug 31 '10 at 3:28
For those who can't get mouseover recent comments to work - you have to mouse over the '3 hours ago' text, not the comment itself. (Maybe it's just me who's dumb...) –  Benjol Aug 31 '10 at 7:01
I would also like a compass –  Shog9 Sep 29 '10 at 4:04
For what it's worth, you could always just set your system clock to UTC. –  Jared Harley Oct 6 '10 at 21:15
@Jared: and change my entire lifestyle to revolve around UTC versus my normal timezone? :P –  studiohack Oct 7 '10 at 20:48

This is an excellent idea! The timezone difference has caused everyone no end of headaches. Here is just a small sample of the benefits:

• People complaining about the 'enthusiast' and 'fanatic' badge have no excuse now!
• Reached the rep. cap? Look at the clock to see when you can get rep. again.

...and...

• Since Jon Skeet lives in Reading, UK, we can now know with certainty when he's asleep and we can actually get rep!
-
exactly! I am very surprised that no one has thought of this before... –  studiohack Aug 31 '10 at 0:13
Jon Skeet sleeps? lies! –  MrABC Aug 31 '10 at 0:22
This would be so nice... Clicking on the today and yesterday tabs currently is so confusing. Having a clock visible would help greatly. –  Peter Ajtai Aug 31 '10 at 1:04
It wouldn't even have to be obvious. Somewhere in the footer, perhaps underneath the revision number would suffice I think. –  Mark Henderson Aug 31 '10 at 2:01
@MrABC: boy, are you in for a surprise. meta.stackexchange.com/questions/555/… –  Pops Aug 31 '10 at 5:28
Maybe a GreaseMonkey script is in order!!! –  uɐɯsO uɐɥʇɐN Aug 31 '10 at 5:33
@Farseeker: ...and done! A GreaseMonkey script that does just that is below. Enjoy! –  uɐɯsO uɐɥʇɐN Aug 31 '10 at 6:21
Pedantic: UK is not currently on UTC, we're UTC+1 being BST until the end of Oct. –  Richard Aug 31 '10 at 8:38
You can also upgrade your second bullet for close votes, delete votes, flags, and normal votes as well. There's a whole lot that people run into and have to wonder when the end of the day is. –  Grace Note Aug 31 '10 at 12:37

Typing UTC time into Google will tell you the current SE time.

-
still! ........ –  studiohack Aug 31 '10 at 0:38

I suppose your suggestion is more applicable now that more Stack Exchange sites are getting off the ground, some of them not technical at all (e.g. Cooking), but a year ago my answer would have been a derisive "What, you call yourself a programmer and you don't know what time it is in UTC?!"

-
very true....+1 –  studiohack Aug 31 '10 at 3:41

# And here it is!

Here is a GreaseMonkey script that does just that! It sticks a small little box to the bottom of every StackExchange page with the current UTC date / time.

// ==UserScript==
// @name          StackClock
// @namespace     http://quickmediasolutions.com
// @description   Shows a clock on StackOverflow with the current time in UTC.
// @include       http://stackoverflow.com/*
// @include       http://superuser.com/*
// @include       http://serverfault.com/*
// @include       http://meta.stackoverflow.com/*
// @include       http://*.stackexchange.com/*
// ==/UserScript==

var cur_date = new Date();

\$("#footer-menu").after("<div style='color: white; padding: 4px; margin-left: 8px; background-color: #999; text-align: center; float: left;'>The current UTC<br>time is:<br><br><div id='utc-time'>" + cur_date.getUTCHours() + ":" + cur_date.getUTCMinutes() + "</div></div>");

-
This one is using the local clock, not the server clock. Not good enough! It might miss a few precious seconds! –  Kobi Aug 31 '10 at 7:02
@Kobi: And your solution is.... ? –  uɐɯsO uɐɥʇɐN Aug 31 '10 at 19:22
@George: Any chance using the recent activity page to get the current time (see above)? –  staticx Sep 1 '10 at 1:05
@Changeling: What would be the purpose of that? –  uɐɯsO uɐɥʇɐN Sep 1 '10 at 1:38
@George: To use the SO time and not local time –  staticx Sep 1 '10 at 11:43
@Changeling: This uses SO time as it is. –  uɐɯsO uɐɥʇɐN Sep 1 '10 at 17:46
@George Edison: Possible solution: Use a NTP client on your computer, most servers' clocks are synchronized through NTP. Ideally, using the same NTP servers would help, but you should get +-5 second accuracy even using different servers. –  Piskvor Oct 7 '10 at 5:48

Some more Greasemonkey User Scripts:

in the top bar, after the links and before the search box

// ==UserScript==
// @name           Stack Exchange Clock
// @namespace      http://stackexchange.com/
// @description    Display UTC clock on Stack Exchange sites.
// @include        http://stackoverflow.com/*
// @include        http://serverfault.com/*
// @include        http://superuser.com/*
// @include        http://stackapps.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://*.stackexchange.com/*
// ==/UserScript==

/* Generate the current time string in UTC. */
function get_time() {
var today = new Date();
var h = today.getUTCHours();

return h + ":" + m + ":" + s + " UTC";
}

if (number >= 0 && number < 10) {
return "0" + number;
}
return number;
}

/* Update the time display. */
function update_time() {
var stamp = document.getElementById('utc-clock');
stamp.innerHTML = get_time();
}

/* Generate the HTML element for the stamp and insert,
wrap time in a link so that it matches nearby styles. */
var time_url = "http://www.wolframalpha.com/input/?i=current%20time";
var time_block = document.createElement("span");
var inner_s = "<span class='lsep'>|</span> ";
inner_s += "<a id='utc-clock' title='Current Time' href='";
inner_s += time_url + "'>...</a>";
time_block.innerHTML = inner_s;

if (target) {
target.parentNode.insertBefore(time_block, target.firstSibling);
}

var f = function() { update_time(); }
window.setInterval(f, 1000);


in the footer after the feedback link

// ==UserScript==
// @name           Stack Exchange Clock
// @namespace      http://stackexchange.com/
// @description    Display UTC clock on Stack Exchange sites.
// @include        http://stackoverflow.com/*
// @include        http://serverfault.com/*
// @include        http://superuser.com/*
// @include        http://stackapps.com/*
// @include        http://meta.stackoverflow.com/*
// @include        http://*.stackexchange.com/*
// ==/UserScript==

/* Generate the current time string in UTC. */
function get_time(prefix) {
var today = new Date();
var h = today.getUTCHours();

return prefix + h + ":" + m + ":" + s + " UTC";
}

if (number >= 0 && number < 10) {
return "0" + number;
}
return number;
}

/* Update the time display. */
function update_time() {
var stamp = document.getElementById('utc-clock');
stamp.innerHTML = get_time("current time: ");
}

/* Generate the HTML element for the stamp and insert,
wrap time in a link to match the style of the menu items. */
var time_url = "http://www.wolframalpha.com/input/?i=current%20time";
var time_block = document.createElement("span");
time_block.innerHTML = "| <a id='utc-clock' href='" + time_url + "'>...</a>";

var target = document.getElementById('footer-sites');
if (target) {
target.parentNode.insertBefore(time_block, target);
}

var f = function() { update_time(); }
window.setInterval(f, 1000);

-

Very good idea!
despite dealing with UTC is not such a big deal for me.
I (must) use it often at work and free time, but I would prefer having it at the top of the page :-)

-

In light of the new top bar, the position of the server clock has changed once again. As noted over in this guide, the position of the clock is now located in the Achievements Bar, which is that little bar graph item in the top left. Shown in the image below.

The information below is no longer relevant, but because I kept the older old clock available when we phased that out, I'm leaving this around too. ♪

Back then it was easier than what we had before back then! When you hover over your display name in the top bar, the dropdown will include a snapshot of the current time in UTC. It's no longer a click away.

Image of old dropdown

The below is deprecated because the system has long been removed, but for posterity's sake...

I notice that no one has pointed it out yet, but...

If you check your recent activity page by clicking on the envelope, it will tell you the current site time. This might satisfy the needs of anyone who can't use the GreaseMonkey script, for now.

Image of older old universal clock

-
I did not follow the dicussion to this, but is there a reason, why I have to even hover? Couldn't it be just visible the whole time between StackExchange- and User-Link or FAQ and Search? –  Jook Sep 25 '12 at 8:26
This answer should be revised in light of the new top bar. –  E.P. Dec 7 '13 at 19:10

## A Problem

I'm all for such a feature, but there's only one problem: if the timestamp is calculated server-side, this breaks caching!

Caching is one of the most important parts of making Stack Overflow run fast, so doing that might not be so good in the long run.

Of course, an alternative is to calculate the timestamp on the client. However, the time on client computers may be incorrect.

-
I guess it could be ajaxed? –  Benjol Sep 1 '10 at 8:20
True, that's a good idea. Normally, I would say, "what if the client doesn't have JavaScript," but many features on Stack Overflow don't work without JavaScript anyway. Good suggestion! :) –  Maxim Zaslavsky Sep 1 '10 at 22:07
Why does it break caching? First, it is only useful for registered users, which are the minority of visitors. Second, the reputation appears on the top of every page, and SO seems to work well with that (thought it doesn't change every second). It is possible to cache only parts of the page or the data. –  Kobi Sep 6 '10 at 5:01

Since the roll out of the new top bar, the universal time for all Stack Exchange sites has moved from the activity drop down to the top right of the achievements dropdown:

-
Is it normal that your avatar is different? –  Marc-Andre Dec 10 '13 at 16:28
That excerpt was taken from an answer that I posted that has been expanded by others, as such, there is a mixture of avatars in the screenshots. –  Flyk Dec 10 '13 at 16:29
Ok, I was wondering if you were using different accounts and made a mistake (in case you would want to correct the situation). –  Marc-Andre Dec 10 '13 at 16:32