How to add a date picker in form using HTML ? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 3 Likes Like Report To add a date picker in a form using HTML, you can use the <input> element with the type attribute set to "date". A date picker is an interactive dropdown that makes it easy to choose the date from a calendar instead of typing it manually. In this article, we will learn how to add a date picker in form using HTML5. Syntax:<input type="datetime-local">Additional Attributes for Date Picker:Attribute ValuesDescriptionMin attributeIt is used to set the minimum allowable date, ensuring users select dates after the specified minimum.Max attributeIt is used to establish the maximum selectable date in a date picker, limiting users to choosing dates before the specified maximum.Step attributeIt is used to define the increment value for date selection, allowing users to jump between dates based on the specified step size.Approach: Create an HTML document that contains a form with an input field.Using a type attribute in the input element which is set to "datetime-local".Example 1: Implementation of datetime-local in an HTML document HTML <!DOCTYPE html> <html> <head> <style> body { text-align: center; } </style> </head> <body> <h2 style="color:green">GeeksforGeeks</h2> <b> How to add a datepicker in form using HTML </b> <br> <h4>Date Of Birth: <input type="datetime-local" id="Test_DatetimeLocal"> </h4> </body> </html> Output: Example 2: Implementation of datetime-local with attributes in an HTML document HTML <!DOCTYPE html> <html> <head> <style> body { text-align: center; } </style> </head> <body> <h2 style="color:green">GeeksforGeeks</h2> <b>How to add a datepicker in form using HTML</b> <br> <h4>Date Of Birth: <input type="datetime-local" id="Test_DatetimeLocal" min="2015-01-01T00:00" max="2025-12-31T23:59" step="1"> </h4> </body> </html> Output: Create Quiz Comment M manaschhabra2 Follow 3 Improve M manaschhabra2 Follow 3 Improve Article Tags : Web Technologies HTML HTML-Attributes HTML-Questions Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms4 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like