RobinJ RobinJ - 19 days ago 7
HTML Question

Input type DateTime - Value format?

In which format should I put the date and time, for use in the HTML5 input element with DateTime type?

I have tried:


  • 1338575502

  • 01/06/2012 19:31

  • 01/06/2012 19:21:00

  • 2012-06-01

  • 2012-06-01 19:31

  • 2012-06-01 19:31:00



None of them seem to work.

Answer

For <input type="datetime" value="" ...

A string representing a global date and time.

Value: A valid date-time as defined in [RFC 3339], with these additional qualifications:

•the literal letters T and Z in the date/time syntax must always be uppercase

•the date-fullyear production is instead defined as four or more digits representing a number greater than 0

Examples:

1990-12-31T23:59:60Z

1996-12-19T16:39:57-08:00

http://www.w3.org/TR/html-markup/input.datetime.html#input.datetime.attrs.value

Comments