# Timewarp in the comment time

This is not a huge issue (not huge at all), but I first noticed this maybe a couple of weeks ago and it's time I mentioned it. The timestamp commentary on comments is saying minutes when it should be saying seconds.

In the example below, it said `8 mins ago` the moment I posted the comment, I then immediately edited it twice, this is what it says:

Note that it would have been a maximum of 60 seconds between when I first posted the question the the second of the edits - certainly nowhere near 9 minutes. I may be a retarded typist (2 edits), but I'm certainly not slow.

• Hmm.. let's see... looks fine to me. Any chance you messed with your computer's time? Commented Jan 24, 2013 at 10:06
• @ShaWizDowArd Coincidentally my machine's clock is..... 9 minutes fast. Obviously the script does an abs() on the time diff so that a negative time doesn't get shown. Problem solved. Post it as an answer so I can mark it. Commented Jan 24, 2013 at 10:11
• If your clock is 9 minutes fast, then the time diff is in fact positive -- comment posting date is 10 o'clock, your clock is 10:09, and thus the comment was posted 9 minutes ago.
– balpha StaffMod
Commented Jan 24, 2013 at 10:13
• @balpha See - I told you I was a retarded typist :) Commented Jan 24, 2013 at 10:22

No worry dear friends, this is NOT a rip in the space-time continuum.

The HTML for the element containing the "... ago" for comments and posts:

``````<span title="2013-01-24 10:11:54Z" class="relativetime-clean">
``````

Then there is clever jQuery code iterating all elements with that class and then with each:

``````d = d.substr(0, 10) + "T" + d.substr(11, 10);
d = new Date(d);
d = ((new Date).getTime() - d.getTime()) / 1E3;
var c = Math.floor(d / 86400);
d = isNaN(c) || 0 > c || 31 <= c ? void 0: 0 == c && (2 > d && "just now" || 60 > d && Math.floor(d) + (u ? "s ago": " secs ago") || 120 > d && (u ? "1m ago": "1 min ago") || 3600 > d && Math.floor(d / 60) + (u ? "m ago": " mins ago") || 7200 > d && (u ? "1h ago": "1 hour ago") || 86400 > d && Math.floor(d / 3600) + (u ? "h ago": " hours ago"))
``````

Where `d` is initially given the value of the span title.

As you see (or can't see if JavaScript is alien to you), the time difference is based on the local machine time, so when that time is off so will be the timestamp displayed.

Don't mess with the Zohan computer time!