Date and time <input> typesBaseline · Widely available
The <input type="date"> and <input type="time"> HTML elements show date and time pickers.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Oct 5, 2021. Widely available since Apr 5, 2024.
Browser support
DesktopChrome
1–19Not supported
20+Supportedsince Jun 26, 2012
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–92Not supported
93+Supportedsince Oct 5, 2021
Current: 157Safari
1–14Not supported
14.1+Supportedsince Apr 26, 2021
Current: 27MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155Firefox Android
4–92Not supported
93+Supportedsince Oct 5, 2021
Current: 157Safari iOS
1–4.2Not supported
5+Supportedsince Oct 12, 2011
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: valueAsDate.
Feature detection
JS · check before using
if ("type_datetime-local" in document.createElement("input")) {
// the type_datetime-local attribute/property of <input> is supported
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLInputElement.valueAsDate | 5 | 12 | 57 | 5 | 18 | 57 | 4 |
| input.type_date | 20 | 12 | 57 | 14.1 | 25 | 57 | 5 |
| input.type_datetime-local | 20 | 12 | 93 | 14.1 | 25 | 93 | 5 |
| input.type_time | 20 | 12 | 57 | 14.1 | 25 | 57 | 5 |