The HTML <input type="datetime"> is a control for entering a date and time (hour, minute, second, and fraction of a second) based on the UTC time zone.
- Content categories Flow content, listed, submittable, resettable, form-associated element, phrasing content.
If thetypehas not thehiddenvalue, labelable element, palpable content.
| Permitted content | None, it is an empty element. |
|---|---|
| Tag omission | Must have a start tag and must not have an end tag. |
| Permitted parent elements | Any element that accepts phrasing content. |
| DOM interface | HTMLInputElement |
Attributes
This element has the following global attributes.
Examples
input type="datetime" name="new_year"
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of '<input type="datetime">' in that specification. |
Living Standard | |
| HTML5.1 The definition of '<input type="datetime">' in that specification. |
Working Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.7 or earlier) | 2 | 1.0 | 1.0 |
| type=datetime | Not supported[1] | Not supported[2] | Not supported | 10.62 | (Yes)[1] |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | 4.0 (2.0) | (Yes) | (Yes) | (Yes) |
| type=datetime | Not supported | Not supported | Not supported | 10.62 | (Yes) |
[1] The datetime type is recognized, but there is no specific UI for it.
[2] Gecko doesn't currently implement the datetime type. See bug 825294.
See Also
<input>element