Input Datetime min Attribute

Definition and Usage

min Attribute 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 Atribute

Instance

Example 1

Get the latest date and time allowed for the date-time field:

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

Try It Yourself

Example 2

Change the latest date and time:

document.getElementById("myDatetime").min = "2010-01-01T21:57Z";

Try It Yourself

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:

  • YYYY - Year (e.g., 2023)
  • MM - Month (e.g., 02 represents February)
  • DD - Day of the month (e.g., 15)
  • T - Required separator if time is specified
  • hh - Hours (e.g., 22 represents 10 PM)
  • mm - Minutes (e.g., 55)
  • ss - Seconds (e.g., 06)
  • TZD - Time Zone Indicator (Z represents Zulu time, also known as Greenwich Mean Time)

Technical Details

Return Value: Ang string na halaga na naglalarawan ng pinapayagan na pinakabagong petsa at oras.

Suporta ng Browser

Ang mga numero sa talahanayan ay naglalarawan ng unang bersyon ng browser na ganap na sumusuporta sa katangian.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Suporta 10.0 Suporta Suporta Suporta

Babala:Ang <input type="datetime"> elementong hindi nagpapakita ng anumang field ng petsa at oras sa lahat ng pangunahing browser kaysa sa Safari.