<input type="datetime">

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. Some browsers may present a visually intricate widget for selecting the date from a calendar with added widgets for adjusting the hour, minute, and second of the time. Other browsers may simply take a text input and require that it be parseable as a date and time.

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 supports the global attributes.

Example

<input type="datetime" name="eventStart">

Result

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.
Recommendation 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 No support[1] No support[2] No support 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 No support No support No support 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

Document Tags and Contributors

 Contributors to this page: Sheppy, Sebastianz, mrenty, teoli, Jeremie, kscarfone, sidgan
 Last updated by: Sheppy,