type=datetime

FilterElements

HTML: <input type="datetime">
XHTML: <input type="datetime"/>  or  <input type="datetime" />

HTML5 only. Creates a combined date/time input control. The value is an ISO formatted date and time that is defined and submitted as UTC time (equivalent to GMT).

Start/End Tags

This is an empty element. In HTML, the end tag is forbidden. In XHTML, the element must be closed with a trailing slash as just shown. Developers may include a space character before the slash for backward compatibility with older browsers.

Specifications

  • HTML5

autocomplete=

Values: on | off
HTML5 only. Allows the user agent (browser) to fill in a field automatically (on) or requires the user to enter the information every time (off). Omitting this attribute causes the control to inherit the autocomplete setting for the associated form element.

autofocus

Values: None in HTML. (autofocus="autofocus" in XHTML)
HTML5 only. Indicates the control should have focus (be highlighted and ready for user input) when the document loads.

disabled

Values: None in HTML. (disabled="disabled" in XHTML)
Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.

form=

Values: id of the form owner
HTML5 only. Explicitly associates the input control with its associated form (its form owner). With this method, the input control does not need to be a child of the applicable form element.

list=

Values: id of datalist
HTML5 only. Indicates that the control has a list of predefined suggestions for the user, which are provided by a datalist element. The value of the list attribute is the id of the associated datalist.

max=

Values: number or string
HTML5 only. Specifies the upper boundary of the accepted value range for the element. The max value must not be less than the min value.

min=

Values: number or string
HTML5 only. Specifies the lower boundary of the accepted value range for the element. The min value defines the base for step operations.

name=

Values: text
Assigns a name to the control; a script program uses this name to reference the control.

readonly

Values: None in HTML. (readonly="readonly" in XHTML)
Indicates that the form input may not be modified by the user.

required

Values: None in HTML. (required="required" in XHTML)
HTML5 only. When present, indicates the input value is required.

step=

Values: any | number
HTML5 only. Indicates the granularity that is expected and required of the value by limiting the allowed value to permitted units. The value of this attribute is dependent on the type of the input control. It may be a number, a text string (such as a date), or the keyword any, which allows any unit value.

value=

Values: YYYY-MM-DDThh:mm:ssTZD
Specifies the initial value for this control.
<input type="datetime" name="post" value= "2004-01-14T18:05:32:00Z">

Rendered Example



The date and time picker form control is not yet supported and can not be displayed.