I am using time tag to define a time—seemed like the right approach ;-)
My problem however is the value I want to place within the time tag is NOW: the present. I get this validation error:
The text content of element time was not in the required format:
The literal did not satisfy the time-datetime format."
Looking at the spec, it doesn't seem possible to define 'NOW'. That's a nuisance. Any ideas on how to approach this?
Definition and Usage The <time> tag defines a specific time (or datetime). The datetime attribute of this element is used translate the time into a machine-readable format so that browsers can offer to add date reminders through the user's calendar, and search engines can produce smarter search results.
You cannot. The time
element in HTML5 is defined as markup for specific moments or periods or durations of time or for time offsets, not for all concepts related to time.
You can write e.g. <time datetime="2013-04-06T13:53">now</time>
, thereby associating a fixed moment of time with the text content “now”. I don’t see how this could be useful, and the usefulness of the time
element in general is questionable (it looks like markup for markup’s sake), but things like this are all you can do to “define ‘NOW’” with time
.
I'm using this markup for now:
<time datetime="2013">Present</time>
No more errors, and it's symatic. It's just a shame there is no accepted variable for NOW.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With