Input DatetimeLocal min Attribute

Definition and Usage

min Attribute sets or returns the value of the min attribute of the local date-time field.

The HTML min attribute specifies the minimum value (date and time) for the local 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 خاصیت

Instance

Example 1

Get the nearest date and time allowed for the local date-time field:

var x = document.getElementById("myLocalDate").min;

Try It Yourself

Example 2

Change the nearest date and time:

document.getElementById("myLocalDate").min = "2023-02-15T18:15:30";

Try It Yourself

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-time field.

Component Description:

  • YYYY - Year (e.g., 2023)
  • MM - Month (e.g., 02 represents February)
  • DD - Day of the month (e.g., 15)
  • T - If a time is specified, then it is necessary to separate
  • hh - Hours (e.g., 22 represents 10 PM)
  • mm - Minutes (e.g., 55)
  • ss - Seconds (e.g., 06)
  • ms - Milliseconds (e.g., 520)

Technical Details

Return Value: 字符串值,表示允许的最近日期和时间。

浏览器支持

表中的数字注明了首个完全支持该属性的浏览器版本。

کروم ایج فائر فاکس سافری آپرا
کروم ایج فائر فاکس سافری آپرا
پشتیبندی 10.0 پشتیبندی پشتیبندی پشتیبندی

توجہ:کوئی ویب سائٹ <input type="datetime-local"> علامت در Firefox میں کوئی تاریخ و وقت کا میدان/کلسٹر نہیں دکھاتا.