HTML Date, Time, Month and Week Inputs
Calendar date and month
date stores a calendar day as a year-month-day string; month stores year and month. The visible picker can be localized while the submitted value stays in a normalized form. min and max use the same format as the input.
<label> Arrival <input type="date" min="2027-01-01" max="2027-12-31" value="2027-05-10"></label><label> Billing month <input type="month" value="2027-05"></label>The stored values are 2027-05-10 and 2027-05.
Time and week
time stores a clock time without a date or offset. Its step is measured in seconds; the default is 60 seconds. week uses a week-numbering year and week number, such as 2027-W05, not a month-day pair. Picker availability differs by browser.
<label> Start <input type="time" step="900" value="09:30"></label><label> Planning week <input type="week" value="2027-W05"></label>The time is 09:30 and the week is 2027-W05.
Local date and time
datetime-local combines a date and a clock time without storing a time zone or UTC offset. A meeting service must know the intended zone separately to convert this value into an instant. Do not assume the device zone is the intended meeting zone.
<label> Appointment <input type="datetime-local" value="2027-05-10T14:30"></label><label> Time zone <select> <option value="Europe/Stockholm">Stockholm</option> <option value="Asia/Baku">Baku</option> </select></label>The date-time and the selected zone are independent values.
Common mistakes and practice
Date pickers are not guaranteed to look alike. Unsupported types may degrade to text. Date step is measured in days, month in months, week in weeks, and time/datetime-local in seconds. Use server validation for actual bookings; a local date-time can even describe a nonexistent wall-clock time during a daylight-saving transition.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Date, Time, Month and Week Inputs — Knowledge Check
Apply the control concepts taught in this lesson.
Which input stores a calendar month?
What is missing from datetime-local?
What does step=900 mean on a time input?
What is a suitable normalized value for a date input?
Which control stores a week-numbering year and week number?