I am showing current time in my web app.
I can show it in a span
or a div
.
But which would be semantically apt?
Neither <span>
nor <div>
has any semantic meaning at all. If you want a semantic time, use <time>
instead. http://microformats.org/wiki/datetime-design-pattern
You can try something like this:
<footer>
<p>Posted by: Hege Refsnes</p>
<p><time pubdate datetime="2012-03-01"></time></p>
</footer>
You can use HTML <time>
tag. You can use this to make the time data readable by a machine. But to display the actual time you need something else, maybe Javascript voor the time of the machine of the user. Or via a server using PHP or a other language.