Sometimes in UI, it requires more brain power to understand “15 hours ago” than “2018-01-10 7:35PM”
– https://twitter.com/ghiden/status/951179673072881665
Hidenari has a point. Sometimes our UI could use a bit more precision. We as developers could be a bit more formal. But how to strike the right balance here?
With the HTML5 element, we can include several forms of date-time information in a variety of ways, including:
- machine-readable format (
datetime
attribute) - “tooltip” for the user (
title
attribute) - shorthand content for the user (text content)
For example:
<time datetime="2018-01-10T19:35:00"> 15 hours ago </time>
Read more about the element at https://www.sitepoint.com/html5-time-element-guide/.