Input DatetimeLocal min Attribute
Definition and Usage
min
Sets or returns the value of the min attribute of the local date and time field.
The HTML min attribute specifies the minimum value (date and time) for the local date and 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
Example
Example 1
Get the nearest date and time allowed for the local date and time field:
var x = document.getElementById("myLocalDate").min;
Example 2
Change the nearest date and time:
document.getElementById("myLocalDate").min = "2023-02-15T18:15:30";
Syntax
Return min attribute:
datetimelocalObject.min
Set min attribute:
datetimelocalObject.min = YYYY-MM-DDThh:mm:ss.ms
Attribute Value
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ss.ms |
Specify the nearest date and time allowed for the local date and time field. Component Description:
|
Technical Details
Return value: | A string value representing the latest date and time allowed. |
---|
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-local"> element does not display any date-time field/calendar in Firefox.