Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have the following HTML code

  <time datetime="2012-08-23">
    23. August 2012

I have that because I felt the "23. August 2012" format was easier for website visitors to read than


Both of those HTML5 examples validate at w3, but the first one is obviously redundant, and I like to cut out markup I don't need. Is there another date formate that I can use in the second example that is (1) easy for website visitors to read, and (2) w3 valid?

share|improve this question
Any of the formats mentioned in the HTML5 spec will do. – Yannis Aug 27 '12 at 8:19
up vote 0 down vote accepted

You have two possibilities. First you can use the attribute "datetime" and the content as free text. On the other hand you have the option to use the content only. With the content only you need to fill in a valid format for the datetime. Currently it has the following format:


In time, no common browser is supporting this tag by default. I could think that there will maybe a time where the tag can handle current culture and different time formats as well. But in time it's not specified.

Therefore you only have the possibility to do it with that kind of redundancy, to stay HTML-conform. Sorry for that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.