Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML <input type="datetime-local">

❮ HTML <input> type attribute


Show a date and time control (no timezone) :

<label for="birthdaytime">Birthday (date and time):</label>
<input type="datetime-local" id="birthdaytime" name="birthdaytime">
Try it Yourself »

Definition and Usage

The <input type="datetime-local"> defines a date picker.

The resulting value includes the year, month, day, and time.

Tip: Always add the <label> tag for best accessibility practices! 

Browser Support

The numbers in the table specify the first browser version that fully supports the element.

type="datetime-local" 20.0 12.0 93.0 14.1 11.0


<input type="datetime-local">

❮ HTML <input> type attribute