Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One pet peeve of mine is "human readable dates", especially for a directory listing. If I'm scanning for something I copied into a folder yesterday amongst other things, I don't want everything to show "1 day ago" if I'm looking for something I did around 11am. I want the dates and times. That goes for forums like HN. Show me the date/time and also "7 hours ago" or whatever if you have to.

I've never understood taking that information away. I wonder if it's a consequence of infinite scroll or something.



I agree. GitHub does this too on commits. "foo.cpp modified last year." It makes no sense, at least without the ability to view additional datetime information.


You can hover over the date for an exact timestamp. Maybe someone can write a userscript to replace the relative dates to exact ones.


This bookmarklet (I prefer to do it on purpose, not by default) would do this on a GitHub page. It is easy to convert it to a userscript.

javascript:(function () { document.querySelectorAll("relative-time").forEach(function (el) { var p = el.parentNode; var t = el.title; var s = document.createElement("span"); s.innerHTML = t; p.removeChild(el); p.appendChild(s); }); })();


Shorter version

javascript:(()=> {document.querySelectorAll("relative-time").forEach((el)=> el.format="datetime")})()

based on docs at https://github.com/github/relative-time-element

you can also do other formats like

document.querySelectorAll("relative-time").forEach((el)=> {el.format= "datetime"; el.year ="numeric"; el.weekday=undefined;})


shortened version still using <span>, as that has better line wrapping:

document.querySelectorAll("relative-time").forEach((el)=>el.replaceWith(document.createElement("span").innerHTML = el.title))


Can’t hover on mobile


You can hover with a pen like the Galaxy S Ultra has. But it doesn't work.


the point is that you should not need to hover over the dates to get the exact ones.

it hinders fast viewing of the data, when it is more than a small amount.


Depends on the application and your personal preference. It's way "faster" for me to see a HN comment was posted "1 hour ago" than it is for me to see the absolute time string and do the math myself. Further, I don't care about the exact time a HN comment was made. I care about roughly how long ago it was posted so I know if the conversation is still going.


But if exact dates/time is shown you have the possibility to mentally subtract one hour from what the time is, and look for that.

With 1 hour/week/month/year you cannot go the other way, it is too vague.

But web pages and apps should provide a quick and easy way of changing between the too formats.


>With 1 hour/week/month/year you cannot go the other way, it is too vague.

It's not just too vague, it's impossible in general.

think about it, first, those who disagree.


yes, that's exactly what I said here:

https://news.ycombinator.com/item?id=41039675


> the point is that you should not need to hover over the dates to get the exact ones.

For you. For some, you should not need to hover over exact dates to get humanized relative deltas.


I’ve never looked at a datetime and thought to myself “if only I knew how long ago that was.” Are there really people like that?

And actually, if I saw the date of “2023-12-07,” knowing it was last December actually gives me more information than “eight months ago” — because I know that means around Christmas time last year, and I know what other things happened last December, such as what features we were launching, who the product manager was at the time, etc. If you just shouted a random number of months ago, I would then have to stop and think about the answers to those questions. Lots of my memories could be placed in an approximate month or at least a season, and those never change after the fact. Relative dates are constantly changing and my memory does not increment all its records every month (e.g. “I’ve now worked here 9 months. I’ve now worked here 10 months.” But I can tell you the month and the year I started working here.)

Relative dates are definitely a case of “just because we can do this doesn’t mean we should force everyone to use it”


so those of us who think differently from you are inhuman?

/jk

humans from long back, could, and still very much can, easily parse / grok those exact dates and do the trivial date arithmetic needed (just mentally, without even pen and paper, forget a calculator), in seconds, to figure out the deltas nearly perfectly, or at least close enough for their needs.

just because you cannot do it, don't think that plenty of others cannot (analogous to what you said to me above). I have interacted with different types and categories of people, of various educational levels and socio-economic backgrounds, from so-called "low" to so-called quite "high", for many years now, and I can tell you that even uneducated farmers, fishermen, bike and car mechanics, and other kinds of manual labourers that I have met and interacted with a good amount, can easily do these kind of calculations in just a few seconds, mentally. not necessarily all, but many of them can.


Huh, I never noticed that. There is a lot of sublety in HN's minimal formatting.


Yeah this makes it better, but I've found some sites that don't do that, blogs and news articles where it's impossible to find the date of published... Is it a SEO trick to make your content always relevant?


Well it will definitely help with caching. You only need to update the article every year or so.


That's still more than just using an exact date that never needs to be updated. Also that seems like something you would do client side anyway. ie. you send a timestamp that never changes and then have the client convert it to "X years/days ago."


Most people render the html on the server side and then you can just cache it wholesale.

You could cache the page itself or even the article itself (I'm not talking about browser cache, I'm talking about caching on the web server).

The idea being that you don't have to keep rendering or even hitting your DB for the content you just have a html fragment that you create once and cache and then serve. You'll only need to rebuild the content when the date expires so when "one year ago" becomes "two years ago" .


Often I want to see exact what time I made a commit to correlate it with some error code and it’s only giving it by day. Such a bummern


Particularly when many systems I've seen group the past three years into last year.

It feels like the categories are:

"Today, Yesterday, This Week, This Month, Last Year, Big Bang"


Gitlab considers everything older than 0.49 years to be "a year ago". Since it's July, that means commits from January 2024 are "a year ago" now!


So annoying, I wrote this extension some time ago to get rid of relative dates in github

https://addons.mozilla.org/en-US/firefox/addon/yyyy-mm-dd-gi...


Yes. If we are in the middle of the current year, modified last year could mean anything from half a year ago to one and a half years ago.


I wonder if sites could use the HTML <time> tag for this. They could choose the human readable format but still give us the time so that it could be replaced or overlayed with some extension.

I always try to use it when writing HTML.

(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ti...)


Yeah that is such an amazing anti-feature. And how do you deal with changes? Like, when does 1 day ago become 2 days ago? According to google it becomes two days ago after 48 hours. That means if you look at your phone after 47 hours it will say 1 day ago and you'll be tricked into it happening yesterday. Human readable my ass.

Or, you know the specific day because it was the day after your friends birthday or whatever. And you try to find a specific item, but you have to sift through an entire months of shit because all the information you get is "three months ago".


The intent make sense (humans are better at durations than with absolute timestamps), but the lack of granularity is ridiculous. It should be "1d 20h ago" or based on the dates in question maybe more or less granual. (It's a hard UX problem, but that just means that the program ought to know what the user wants. What's important to them. Are the searching for something? What patterns to highlight? Ie. if there's a directory with a 1000 files but only 2 old ones maybe put some emphasis on them, etc.)


I utterly hate this on iOS. Suddenly after an hour or something, you irretrievably lose the time on a notification. There’s not even some fiddly power user way to force it to show you.


This is a setting, you can change it to any other date format you want.


Yep, `--time-style`.


Yes, I hate that approach too. I think it started with either Web 2.0 startups (I was working with one at the time, that implemented that in their product), or with Google and suchlike companies around that time, in their general web apps or social media web apps.

I agree, they should provide the detailed time, then provide the days ago thing too, if they want to.


The same I feel, so I didn't bother to print human readable dates in my open source mlops project. xvc file list[0] prints times in the same format even if it changed a minute or a year ago.

[0]: https://docs.xvc.dev/ref/xvc-file-list


You can hover over the time on HN and get a timestamp.


Not if you are on a phone or similar device, which lots of people are. Important info like that should never be only accessible by hovering a mouse pointer that may or may not exist.


One thing I really like about all of the ago formats:

- What it says: 1 year ago

- What it is: 1 year and 10 months ago




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: