Hacker News new | ask | show | jobs
by fushihara 321 days ago
I just want to display the last updated time in the corner of a blog post. Overwriting local innerText with JavaScript for that is nonsense.

Displaying relative time like “1 day ago” is especially foolish. Does that mean between 0s–23:59:59? Or 24:00:00–47:59:59? Or perhaps 24:00:00–6d 23:59:59?

When you have multiple browser tabs open and switch between them, and you see “just now” — is it really just now? You last looked at that tab an hour ago. Maybe two hours? Maybe it’s been open since yesterday.

Sometimes I wonder why the Accept-Timezone header doesn’t exist in web browser requests. Using Accept-Language to switch webpage language based on the same URL is now commonplace.

There would likely be demand for a feature where the <html> contains a Unix timestamp, and the browser renders it using the client’s local time zone:

<time epochMs="1234567890123" format="YYYY/MM/DD HH:mm:ss" />

Just write it into static HTML and you’re done. No need for the server to compute relative times, and no need to rewrite it dynamically with JavaScript.

What happened to the movement to abolish daylight saving time? A few years ago, I kept hearing that the US and EU were moving toward ending it. Yet here we are, still observing DST this year.

1 comments

> Displaying relative time like “1 day ago” is especially foolish. Does that mean between 0s–23:59:59? Or 24:00:00–47:59:59? Or perhaps 24:00:00–6d 23:59:59?

> When you have multiple browser tabs open and switch between them, and you see “just now” — is it really just now? You last looked at that tab an hour ago. Maybe two hours? Maybe it’s been open since yesterday.

I have a screenshot of two Jira comments that go from "one year ago" to "one hour ago" because the two comments happened to be something like Dec 31 and Jan 2.

I am sure the "as a user, I should see relative timestamps" ticket was closed fast though! Another job well done!
So it does not take the year into consideration? Well damn.