Time of events
1 January 2024Let's talk about how to represent time of events in user interfaces. For example, we have some articles in a blog and we would love to let reader know when each one of them was published. Usually there are two ways to go: simply show date and time (like 15 May 2015 15:07), or show relative time (like 4 days ago).
If you think about it a bit, you will see that showing relative time does not make any sense and uninformative. '6 weeks ago', '17 days ago', '2 weeks and 5 days ago' – how long is that? How could this information be more helpful than a plain date?
In most cases people are aware what date it is today to make calculations by themselves if they need to. Compare that to the effort needed to convert relative '6 weeks ago' to the date in your head. Even if it is '2 days ago', that is less informative than a plain date.
Another benefit of absolute time format is that it always takes predictable amount of space opposed to relative format.
You never know how many characters this will take in your interface:
- Edited 2 weeks ago
- Edited 3 months ago
- Edited few minutes ago
For some layouts this can be rather important.
On the other hand space taken by date here is always 10 chars:
- Edited on 15.03.2023
- Edited on 07.06.2021
It is always a win to choose plain date over relative time to specify timestamp of event.