You should not be displaying relative dates • Aaron Parecki

submited by
Style Pass
2021-08-18 22:30:03

Every time I see a web app display a date as "30 minutes ago" I cringe a little. This was cute 10 years ago when rapid publishing on the web was new, but there are a number of problems with this.

How many times have you seen a screenshot of a tweet that says "28 minutes ago"? Months later, you've completely lost the date of the tweet.

If you've just put a relative date in a tag, all of a sudden the date is not machine readable. If you insist on using relative dates, at least mark it up with the appropriate HTML5 element so there is a machine-readable version of the date.

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?

When viewing a thread of emails, Gmail uses a different format of date depending on how long ago the date is. If the date is less than 24 hours ago, it will show just the time. If older, then it shows just the date and a number of days ago.

Leave a Comment