How can I semantically define within the <time> tag 'the present'
Asked Answered
L

2

5

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?

Limicolous answered 6/4, 2013 at 8:40 Comment(3)
What's the use case for this?Thekla
Good question; the use case context is a resume listing of projects and experience. But I want it all to be machine readable as well.Limicolous
Duplicate of Today's time in time tag (shameless plug: my own question :) )Imbibe
A
5

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.

Alcmene answered 6/4, 2013 at 10:56 Comment(1)
I think it can be very useful, e.g. here on Stack Overflow it says for this answer "answered 4 hours ago". Now "4 hours ago" could be marked up with the time element, containing the publishing time. If someone archives the page, such relative time references aren't useful, but thanks to time the date can be included in a formal way.Tabulate
L
3

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.

Limicolous answered 13/4, 2013 at 11:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.