TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why you should not be displaying relative dates.

213 pointsby caseorganicover 12 years ago

52 comments

bryneover 12 years ago
This is a ridiculous argument - relative dates are an enormous usability improvement for actual users, who don't care about machine-readable timestamps or the incredible mess that is timezones.<p>Twitter also doesn't give a fuck about archival via screenshots. I'm pretty hard-pressed to imagine who would, actually.
评论 #4425251 未加载
评论 #4425263 未加载
评论 #4426082 未加载
评论 #4425701 未加载
评论 #4425551 未加载
评论 #4425212 未加载
评论 #4425117 未加载
评论 #4425123 未加载
评论 #4430687 未加载
评论 #4425910 未加载
评论 #4425738 未加载
评论 #4428375 未加载
评论 #4425435 未加载
verisimilitudeover 12 years ago
Here's what I do. First, the markup: &#60;time datetime="2011-08-27T19:1­5:38Z" pubdate&#62;27 Aug, 2011&#60;/time&#62; So, time in [ISO 8601][0] format. Run JS to transform '27 Aug, 2011' into a relative date. If the relative date is &#62;1 month (or, whatever you'd like), then just display the full date.<p>[0]: <a href="http://en.wikipedia.org/wiki/ISO_8601" rel="nofollow">http://en.wikipedia.org/wiki/ISO_8601</a>
评论 #4425264 未加载
评论 #4426958 未加载
bernardwilsonover 12 years ago
This is the wrongest thing I've read in ages.<p>a) Who cares about screenshots? "I'm going to the pub on Thursday" suffers from exactly the same issue. b) Nonsense. Of course relative dates are machine readable. But anyway, web rendering != API. c) These examples are not ambiguous, they are merely less <i>precise</i><p>And less precision is, indeed, often what a user <i>wants</i>. That's why we don't print "posted 124568080nanoseconds ago". Simplifying to a reasonable unit, appropriate to the application, reduces cognitive load on the user. Most people struggle to tell you today's date, let alone knowing how long ago an arbitary timestamp was.<p>I like twitter (who maintain a relative date on the top-right of the feed entry) and gmail <i>exactly</i> the way they are.
评论 #4425167 未加载
评论 #4425145 未加载
jereover 12 years ago
I think a bigger problem is absolute dates with no year; I've seen this on blog posts and comments (can't remember any examples right now though).<p>At first, I'm tempted to think "oh that must be from this year then", but I'm often wrong and it's just a floating date.
评论 #4425094 未加载
评论 #4426953 未加载
评论 #4425395 未加载
run4yourlivesover 12 years ago
Lot's of love for relative dates, but personally, I agree with the poster. Here's an example from HN:<p>user: run4yourlives<p>created: 2012 days ago<p>Got any idea how long I've had an account for? I sure as hell don't, because 2000 days is a completely irrelevant measurement to me.<p>It would be a lot cleaner just to say that I've been around here since 19 Feb, 2007.<p>I think this is a bigger point than just the dichotomy between dates. If you are trying to make them mean something, make them mean something. 2 hours ago is fine, but 23 days ago is most certainly not. Was that a weekend? A morning? Last Tuesday after work? Who knows.<p>Actual dates work for longer periods of time, relative much better for shorter frames. Stick to this, for the love of God please.
评论 #4425333 未加载
评论 #4425298 未加载
评论 #4425309 未加载
评论 #4426944 未加载
nostromoover 12 years ago
"2 hours ago" is actually more informative than "1:08 PM 23 Aug". The latter requires a location to be exact (1pm where? Is this being localized? Do you guys use daylight savings?) and the former does not.
评论 #4427328 未加载
评论 #4425207 未加载
jerhinesmithover 12 years ago
As a sometimes developer of web applications, relative dates nicely (for me) solve the problem of timezones. "10:42 PM - 15 Aug 12" means nothing without the relevant timezone information. "30 minutes ago" is timezone agnostic.<p>For non-commercial apps, lately I've been displaying relative time, but embedding the actual datetime (in UTC) as a title attribute.
评论 #4425092 未加载
noblethrasherover 12 years ago
You probably shouldn't hijack the keyboard shortcuts for the back button either.<p>Nice article otherwise.
评论 #4425089 未加载
asmakladover 12 years ago
I think the point of showing relative dates is that the web is International and cross border. and if you display a date time. You need to define next to it Which Timezone !<p>Then it would be complicated for the users living in USA to read the status of His Japanese friend that is stamped with a future date while it was actually posted a minute ago.<p>Another Scenario: Which Time-stamp you want to use. the Client or the Server ? Imagine a user in London using a server in Singapore, which time stamp you want to display, the Java-script generated Time-stamp for the Client's browser in London, or the Server time-stamp in Japan ?
nathan_f77over 12 years ago
Relative dates are awesome. They're easier to understand, and save us a lot of space. We use the timeago [1] jQuery library. It shows relative dates in an abbr tag and keeps the microformat in the title attribute, which shows in a tooltip on hover. We use the en-short [2] locale, so it formats times like '1y ago', '1mo ago', '3m ago', etc.<p>I think Gmail's format is the best of both worlds, but we don't have the space for it in our sidebar gadget. Finally, the screenshot argument isn't very convincing, and neither is machine readability or ambiguity. They're formatted for humans, and they're ambiguous on purpose.<p>[1] <a href="http://timeago.yarp.com/" rel="nofollow">http://timeago.yarp.com/</a> [2] <a href="https://github.com/rmm5t/jquery-timeago/blob/master/locales/jquery.timeago.en-short.js" rel="nofollow">https://github.com/rmm5t/jquery-timeago/blob/master/locales/...</a>
luneyover 12 years ago
I find relative dates to be the most useful, most of the time. The scenarios where needing the exact date or time come less frequently.<p>The argument for screenshots is valid, however, sites like failbook where you see the post progression as X minutes ago still provide you the quick glance benefit of relative dates.
ianstormtaylorover 12 years ago
The problem is not relative dates in context. Relative dates in context are extremely useful! Would I rather have to parse "4:50pm January 10th, 2012" or "5 minutes ago".<p>---<p>The real problems:<p>1. Old relative dates aren't useful.<p>- Instead of "1 year ago" give me a real date. I can figure that out for myself. OR give me the option of getting a real date easily (hover, or click, or something).<p>2. Relative dates are shared statically.<p>- Listen for print-screen commands and swap things to relative dates. (I have no idea if this is possible. I actually would bet that it isn't, but maybe it should be.)<p>- Make embedding real HTML much easier so when people think about embedding tweets they don't choose images just because they are easier.<p>- Make embedding real HTML much more advantageous (real retweet button, view conversation button, etc.) so that people want to use it instead of static (read: lame) images.
评论 #4426191 未加载
arsover 12 years ago
An entire article on dates and not even the slightest mention of timezones?
评论 #4425134 未加载
dredmorbiusover 12 years ago
Add to peeves: news sites which fail to include bylines indicating one or more of: author/reporter, city/location, date.
kellysuttonover 12 years ago
There's a great jQuery plugin that we use at LayerVault to handle this called timeago: <a href="http://timeago.yarp.com/" rel="nofollow">http://timeago.yarp.com/</a><p>If you're taking screenshots of things, that's your own prerogative.
kapowazover 12 years ago
This sounds like more of an argument for why you shouldn't be distributing stuff in the form of screenshots (although the horrendous entropy of the web is a compelling argument in favour of that, I realise).
grecyover 12 years ago
&#62; Now, Twitter uses the format "10:42 PM - 15 Aug 12"<p>Wouldn't including the relevant timezone be even better?
评论 #4425046 未加载
tb303over 12 years ago
ridiculous argument and bad misinformation. relative dates are better for users in any context involving event freshness/recency, and they are machine readable by using many well-known markup techniques, including the microformat he mentions.
csomarover 12 years ago
<i>If you're looking at an email and it says "2 hours ago," how are you supposed to know if it's rounding the number or giving you an exact value? If it's currently 11:15am, was the email sent before or after your 9:00am phone call?</i><p>I actually find this pretty convenient. I don't remember days numbers. 5 days ago gives me a perspective. If I want the exact time, I'll just unfold the email tab. (I'm talking about the Gmail example he picked)
machriderover 12 years ago
Speaking of crappy user interfaces, his blog breaks the Alt+Left keystroke to go back. It takes me to previous blog entries, rather than back to HN. Grrr.
jedbrownover 12 years ago
The archival quality of something displayed on the screen is not as small of a factor as some people are making it out to be. I can't count the number of times a poor user has pasted the output of "hg log" into an email without stripping the sequence number out of the changeset line, only to confuse another mailing list reader when they look for the patch using the sequence number.
nodesocketover 12 years ago
This totally depends on context. For example, on HN, relative dates are great, it is much easier to see how old posts are at a glance. However, anything where date is important, use the full representation.<p>The more interesting question is, what is the best (easiest to read) way to format a full date? I believe it is: 8/1/2012 10:10:48 PM. I find twitters format slower to read: 10:10 PM - 1 Aug 12.
评论 #4425679 未加载
uranmoronover 12 years ago
Incredible timing, I was just thinking how irritating this is on Github.
评论 #4425069 未加载
评论 #4425381 未加载
ZenJoshover 12 years ago
My general rule for relative dates is:<p>Timestamp (00:00am/pm) within 1 day Day of the week (Monday-Sunday) within 1 week Full date (00/00/0000) everywhere else<p>I also make sure I provide a way to view the full date (eg Saturday 1st December 2012 at 1:27am) somewhere in a 'more details' modal or pane.
gatordanover 12 years ago
I dislike when an author titles and formats their post in this way. The title is an overstatement about why something that is common practice is wrong ("hey! i use relative dates, what am i doing wrong?"), leading to an article with a couple interesting points, ending with a concession that common practice is actually OK but could be better.<p>I agree with others that the argument is pretty weak considering twitter screenshots are one of three reasons why we should avoid relative dates. But i would have felt it genuine if the thesis was his last sentence: "Avoid displaying relative dates, but if you feel like you absolutely need to, follow these best practices: ..."
srikover 12 years ago
One interesting solution would be to have the html contain/display the exact date, so any scrapers etc. have access to the precise date BUT use a Javascript/CSS overlay the relative date on top of that exact date.
twinsnesover 12 years ago
I have no problem with relative time stamps. They are conceptually easier for me to relate than absolute time stamps.<p>What does annoy me though is when you have 05-06-12, is that dd-mm-yy or mm-dd-yy?
i386over 12 years ago
I work on a product for software developers and speaking to our customers there are two camps: those who like relative dates and those who like absolute dates. What does HN prefer?
binaryorganicover 12 years ago
I agree with all the dissent posted here.<p>And also, doesn't Twitter's extreme attention on embedded tweets lately underscore how little they care about screenshots? Not to mention the fact that while they have, as the post suggests, resorted to timestamps on individual pages, they are still using relative timestamps in the main stream.<p>As a user, I prefer relative time. And since relative time views are almost always displayed in sequence, most of the arguments laid out in the post fail to matter.
idohover 12 years ago
I'm the PM for a horoscopes app, and I much prefer to use relative dates (e.g. yesterday, today, tomorrow) instead of absolute ones (e.g. wednesday, thursday, friday).<p>The problem is that the app serves a worldwide audience, and I don't always know the locale of the user. By showing relative dates, everyone feels happy that they are seeing today's horoscope today. With absolute dates I'd get a lot complaints that they were seeing yesterday's horoscope for instance.
cyberpantherover 12 years ago
I've always hated relative dates. Glad people are finally coming to their senses. The only case I see for relative dates are that they are more user friendly. But is it really that hard to parse "Wednesday, August 22nd at 8:22PM"? While I believe in easy to use interfaces, we don't have to act like our users are total bafoons either.<p>In the long run relative dates are more confusing for screenshots, leaving a page open, etc as stated in the post.
Geeeover 12 years ago
The reason why relative dates are used is that you don't have to worry about timezones. You either have to get client's timezone and reformat dates, or use static timezone and let users do the conversions in their heads.<p>Personally I prefer relative dates, because that's the information I'm looking for. I don't care if some screenshots break; there shouldn't even be any reason to take screenshots of tweets etc.
pavel_lishinover 12 years ago
Is it ironic that this blog post only includes the date when it was published, not the time? I wonder if it was before or after that 9am email.
noblethrasherover 12 years ago
Create an `@media print` css rule that displays absolute date/times (with time zone). That's just about the best of both worlds.
xutopiaover 12 years ago
It's funny his example is with Twitter screenshots. It's one of those things I hate. Why not link to the real thing instead?
raneover 12 years ago
&#62; Twitter has since stopped using relative dates on their tweet pages, and instead just shows the full date now.<p>This part made me feel the argument is suffering from confirmation bias. Twitter has only removed the relative date from the page where a tweet is accessed directly, not in the timeline where the relative timestamp is absolutely relevant.
bradezoneover 12 years ago
I totally agree, this is another case of software thinking it's smarter than me. This is really a problem on blogs, where you'll have 5 comments in a row that say "posted 1 hour ago" and you have no idea the order you're supposed to read them. Common sense nullified by "smart" apps yet again...
winter_blueover 12 years ago
If you push this argument further, missing time zones are a problem as well. I recently moved between continents, and the time zone difference sometimes results in gmail conversation threads showing send times ("On Aug 15 9:00 PM Someone wrote: ...") that appear to time travel.
streeterover 12 years ago
He must hate the dates on Hacker News.
tsielingover 12 years ago
I think there's room for both relative and absolute. Encode the absolute in the metadata for machine readability and display relative to the people for as long as it makes sense. We can go beyond 'it must be 0 or 1' when it comes to the presentation layer!
hcarvalhoalvesover 12 years ago
Just two things:<p>1. Why are you sharing information in screenshots in the first place?<p>2. Use appropriate microformats and tags for marking up dates, so you're free to display whatever to the user:<p>&#60;time itemprop="datePublished" datetime="2012-08-04T22:33:31"&#62;2 weeks, 5 days ago&#60;/time&#62;
dllthomasover 12 years ago
Rounded dates make it less obvious when you've been posting during work hours...
mikey_pover 12 years ago
So you don't prefer them and that's why I shouldn't do something?<p>I'd also prefer that your website not high jack the back key-command so that I could go back to Hacker news without clicking the back button in my browser.
ndaugherty18over 12 years ago
If you are worried about not knowing when the screenshot was taken couldn't you include in the actual file name the date the screenshot was taken in a "machine readable" format?
评论 #4429292 未加载
rohitarondekarover 12 years ago
Are there any UX or usability studies regarding date time formats to use on the web? I'd be interested in knowing more than <i>this feels right to me</i>. :)
prunebeansover 12 years ago
Tell me about it. Now my sister hates me, my uncles don't want to speak to me anymore, and my cousins play darts with my pictures...
philfreoover 12 years ago
I like using <a href="http://timeago.yarp.com/" rel="nofollow">http://timeago.yarp.com/</a> with the HTML5 time tag.
fshenover 12 years ago
I agree with the author. And Absolute are cacheable. It's readable. what's wrong with 2012-08-24 10:16:59?
tommymorganover 12 years ago
You should also not override the keyboard shortcut for navigating back (alt-left arrow).
eranationover 12 years ago
I completely agree, I always show both, keeps everyone happy.
ikaweover 12 years ago
tried to wrap up some of the discussion with this rails gist:<p><a href="https://gist.github.com/3471071" rel="nofollow">https://gist.github.com/3471071</a>
nilvedover 12 years ago
Why would you ever use `abbr` with `title` instead of `time` with `datetime`?
评论 #4425267 未加载