0

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?

Harish
  • 490
  • 2
  • 11
  • 19

3 Answers3

3

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

recursive
  • 83,943
  • 34
  • 151
  • 241
1

You can try something like this:

<footer>
  <p>Posted by: Hege Refsnes</p>
  <p><time pubdate datetime="2012-03-01"></time></p>
</footer>
Suchit kumar
  • 11,809
  • 3
  • 22
  • 44
0

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.

koosie
  • 54
  • 4