INPUT Datetime Description:
The datetime INPUT tag gives you a way to request dates with times in your web form. The date will be collected with the year, month, and day and the time will be collected with hour, minutes, seconds, and fractions of seconds, and the timezone set to UTC. The browser or user agent should display a calendar and clock or other date control input device to allow users to submit dates.
DTD: HTML5: <!doctype html>
INPUT Datetime Web Browser Support:
At this time, only Opera 9+ supports the INPUT datetime type with a calendar (see screen shot above). All other browsers display a text box. You can still use this input type, you will just have to validate that the contents are a date and time with a script or CGI.
HTML Versions
INPUT Datetime Attributes:
Global attributes, event attributes, and the input tag attributes. Plus: </p>
- autocomplete
- list
- max
- min
- readonly
- required
- step
- valueAsNumber
- selectedOption
- stepDown()
- stepUp()
INPUT Datetime Usage:
Standard datetime input tag
<form>
<input type="datetime" value="2010-12-16 12:01:00 UTC;">
</form>
See an example of a standard datetime input tag.
INPUT Datetime Special Notes:
The input datetime tag is only supported in Opera 9+ if you want a calendar displayed, but you can still use this input type and validate that the submitted data is a date. That way, when other browsers do start supporting it, your forms won't have to be modified.


