A long time ago I watched a WWDC session video where Apple introduced an API which would print a time interval in a humanly readable, localized form.
Instead of printing a date when someone posted a comment, it was very easy to print a localized string such as "2 hours ago" or "Yesterday" or "Last week".
I can't find that video anymore and no references or examples for this API. I'm sure that it was a dedicated API to directly get this kind of localized strings for date intervals relative to the current date.