Is <time> used?

Hi! Just wandering if <time> is used at all? So many websites have some sort of time data, but I've never seen the time tag used on them. Is there a reason for this?
15 Replies
majkl
majkl10mo ago
Never used it myself. What is the context? Semantics?
Å Marlon G
Å Marlon GOP10mo ago
majkl
majkl10mo ago
Perhaps in a form or some time picker.
Jochem
Jochem10mo ago
You should use it if it's appropriate
Å Marlon G
Å Marlon GOP10mo ago
I remember Kevin making a video about tags that we shouldn't really use, for all sorts of reasons. The time tag was not one of them, but just very curios why it isn't more used since time data is everywhere. Yes, it seems like a very easy thing to just do.
Jochem
Jochem10mo ago
People are lazy
majkl
majkl10mo ago
If I need to offer it to google, I will use schema anyway and only add the CMS-generated date to a span or somthing. I do not car about accessibility rules either so this is a low priority. Perhaps I will have a look over time sometime.
Å Marlon G
Å Marlon GOP10mo ago
Am I right to remember that somewhere in Kevins universe there's a video of tags that we don't use that should be used?
Jochem
Jochem10mo ago
I honestly don't remember. Best bet is to look at mdn and check the usage notes. Just don't use semantic elements unless you're sure you're using them right, bad use is worse than just using divs and spans
Å Marlon G
Å Marlon GOP10mo ago
Indeed. But e.g. when displaying multiple events in a program, the starting time for each event would be a logical place for the time tag, right?
Jochem
Jochem10mo ago
Yup, think so Just make sure to follow the usage notes
Å Marlon G
Å Marlon GOP10mo ago
Thanx!
Kevin Powell
Kevin Powell10mo ago
I'd use <time> for anything from specific times to when blog posts are put up and other stuff. If it's a date and/or time, no reason not to use it 🤷. I did talk about <time> in a video, but I don't remember which one it was... it might have been one of my "obscure HTML elements" videos, I did 2 or 3 of those. I'd also say, if you want to see if you're doing it 'correctly', looking at large, well known websites probably isn't the way to go, most of them are terrible, lol. Look at ones that take markup seriously, like https://www.a11yproject.com/ - if you go to their posts, you'll see they use it for them. Smashing Magazine does too, for two quick examples if you want to see it used in the real world 🙂 - I could probably find more if you're curious
Å Marlon G
Å Marlon GOP10mo ago
It just seems like an easy semantic win, really ... I'm guessing my take away is to look for specific tags if what I'm adding is something specific from the real world. It just fell into my head that time is so specific that maybe there is a tag for it. And, I will spare you any time spent finding more examples. The fact is, from now on I will use it. Anything time related lives in a time tag. Easy-peasy!
Want results from more Discord servers?
Add your server