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
majkl4mo ago
Never used it myself. What is the context? Semantics?
Å Marlon G
Å Marlon G4mo ago
majkl
majkl4mo ago
Perhaps in a form or some time picker.
Jochem
Jochem4mo ago
You should use it if it's appropriate
Å Marlon G
Å Marlon G4mo 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
Jochem4mo ago
People are lazy
majkl
majkl4mo 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 G4mo 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
Jochem4mo 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 G4mo 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
Jochem4mo ago
Yup, think so Just make sure to follow the usage notes
Å Marlon G
Å Marlon G4mo ago
Thanx!
Kevin Powell
Kevin Powell4mo 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 G4mo 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
More Posts
Design for A11y, hide accordion section with css or javascript ?This is for an application that requres log in. I wonder if what I see visually on the page should Is there a bug in Chrome for Android for the position fixed grid children?Hi everyone! Does anyone know if there is any recent change in Chrome for Android generating this wWebsite responisveHi, i started my journey towards fullstack developer about 3 weeks ago and i accepted to create a weHow to display content in a separate smaller window while still being on the main page?Hello everyone, I am designing a desktop app using Electron and React. I would like to display someHaving trouble centering nav bar with content on right/ nav bar shifts depending on text lengthI've created a demo here: https://4c6584fa.portfolio-8nc.pages.dev/ At the very top I am having troNeed help fixing a glitch with my buttonI'm not sure how why its doing what it's doing but whenever I hover and then hover off the btn it do<div> cannot appear as a descendant of <p>. at divGuys help me I am a beginner in JS Some one help me how to solve this error plz Warning: validateDOKey and Code values for "enter" key in mobileMy project isn't working on mobile devices. On desktop, it works when the user press "enter" or "bacbackdrop filter cannot work on firefoxi deployed this webon vercel , some errors occur when I hover on "Product" and the text does not appIs there another way to do this?I want to generate a random word, when the users enter the site I want it to generate a random word,