Input Datetime min Attribute
Definition and Usage
min
Sets or returns the value of the min attribute of the date-time field.
The HTML min attribute specifies the minimum value (date and time) for the date-time field.
Tip:Use the min attribute and max attribute to create a valid value range.
Tip:To set or return the value of the max attribute, use max attribute.
See also:
HTML Reference Manual:HTML <input> min Attribute
Instance
Example 1
Get the latest date and time allowed for the date-time field:
var x = document.getElementById("myDatetime").min;
Example 2
Change the latest date and time:
document.getElementById("myDatetime").min = "2010-01-01T21:57Z";
Syntax
Return min attribute:
datetimeObject.min
Set min attribute:
datetimeObject.min = YYYY-MM-DDThh:mm:ssTZD
Attribute value
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD |
The latest date and/or time allowed for the specified date-time field. Component description:
|
Technical details
Return value: | A string value representing the allowed nearest date and time. |
---|
Browser Support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 10.0 | Support | Support | Support |
Note:The <input type="datetime"> element does not display any date-time field/calendar in any mainstream browser except Safari.