HTML <input> type="datetime-local"

The <input> tag with a type="datetime-local" attribute creates an input field that accepts a date and time value which does not include the timezone (hence ‘local‘).

Clicking the calendar icon opens a datetime picker.



An <input> element of type datetime-local.
Clicking the calendar icon opens a datetime picker. Alternatively, enter a datetime directly into the field.

Registration date

<form action="/tutorial/action.html">
    <legend>Registration date</legend>

    <input type="datetime-local" name="registrationdate"><br /><br />

    <input type="submit" value="Submit">

Using input type="datetime-local"

The <input type="datetime-local"> tag creates an input field for date and time.

The -local suffix does not mean the time is local to the user, instead it is a time without a timezone.

The UI of this control varies from browser to browser. Browser support is limited.

A similarly named <input type="datetime"> is obsolete.


<input type="datetime-local">

Browser support

Here is when type="datetime-local" support started for each browser:

25.0 Jan 2015
Not Supported
38.0 Nov 2015
10.0 Aug 2009
Partial Support

You may also like

 Back to <input>

Last updated on Sep 30, 2023