coderef

Date and time <input> typesBaseline · Widely available

The &#x3C;input type="date"> and &#x3C;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: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–92Not supported
93+Supportedsince Oct 5, 2021
Current: 157
Safari
1–14Not supported
14.1+Supportedsince Apr 26, 2021
Current: 27
MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155
Firefox Android
4–92Not supported
93+Supportedsince Oct 5, 2021
Current: 157
Safari iOS
1–4.2Not supported
5+Supportedsince Oct 12, 2011
Current: 27

How 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
}

Sub-features

Support for each part of the feature (4). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLInputElement.valueAsDate51257518574
input.type_date20125714.125575
input.type_datetime-local20129314.125935
input.type_time20125714.125575