Summary -

In this topic, we described about the Datetime Input type with detailed example.

Datetime input type accepts the user to choose a date and time along with timezone, but it is not supported Firefox, Internet Explorer, Opera or Chrome browsers. It endorses only Apple Safari.

Syntax -

<input type="datetime" id="entry-day-time" >

Example -

Below example explained to choose a date and time along with timezone.
<!DOCTYPE html>
<html>
  <head>
      <title>html5 data input type</title>
      <meta charset="utf-8" />
  </head>
  <body>
      <div class="container py-5">
          <h4><span class="text-danger">datetime</span> 
                                             input type in html5</h4>
            <form>
               <div class="form-group">
				<input type="datetime" id="datetime" class="form-control
                                                         col-md-3" />
               </div>
            </form>
       </div>
  </body>   
</html>      

Output -

datetime input type in html5

Browser Support

The following browsers and corresponding versions in the table that completely supports the datetime type .

Input Type Chrome Edge Firefox Safari Opera
Type=”datetime” 20.0 12.0 57.0 Not Supported 10.1