Skip to content
Related Articles

Related Articles

HTML | <input type=”date”>

Improve Article
Save Article
  • Last Updated : 22 Jul, 2022
Improve Article
Save Article

The HTML <input type=”date”> is used to define a date picker or control field. The value will be the year, month and day. 
Syntax: 
 

<input type="date"> 

Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>HTML Input type = "Date" </title>
    <style>
        h1 {
            color: green;
        }
         
        h2 {
            font-family: Impact;
        }
         
        body {
            text-align: center;
        }
    </style>
</head>
 
<body>
 
    <h1>GeeksforGeeks</h1>
    <h2>HTML <input type="date"></h2>
 
    <input type="date"
           id="test"
           value="2019-07-02T25:32Z">
 
</body>
 
</html>

Output: 
 

Supported Browsers: 
 

  • Google Chrome 20.0 and above
  • Firefox 57.0 and above
  • Edge 12.0 and above
  • Opera 11 and above
  • Apple Safari 14.1 and above

 

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!