How to Set input type date in dd-mm-yyyy format using HTML? Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report In HTML, you can use the <input> element with the type date to allow users to pick a date. However, the format used for displaying the date may vary depending on the browser and the user's locale settings. By default, the browser uses the ISO format (yyyy-mm-dd), which is not the same as dd-mm-yyyy. Unfortunately, HTML itself doesn't provide a way to directly set the date format to dd-mm-yyyy using the <input type="date"> element.Note: The default values for the min and max attributes are min="01-01-1920" and max="01-01-2120".Using the type="date" Attribute The type="date" attribute generates a date picker in compliant browsers. The displayed date format, however, isn't consistent across all browsers and might differ depending on the browser's settings. Syntax<input type="date">Example 1: Basic Date InputIn this example, we set the input type as date, allowing users to pick a date from a calendar. However, the format of the date may vary depending on the user's browser. HTML <html> <head> <style> body { text-align: center; } </style> </head> <body> <h3>Setting Input Type Date in dd-mm-yyyy Format</h3> <label for="start">Enter the Date:</label> <!-- Date input field --> <input type="date" id="start" name="begin" value="" min="1997-01-01" max="2030-12-31"> </body> </html> Output: input type date in dd-mm-yyyy format using HTML Example OutputIn this Examplemin="1997-01-01" and max="2030-12-31" define the date range that users can choose from.The format for the input field is displayed based on the browser's locale and cannot be controlled directly with HTML alone.Example 2: Date Picker with Range AttributeIn this example, we set a date picker where the range is defined using the min and max attributes, which restricts the user to selecting dates within this range. The date format is still determined by the browser and is typically in yyyy-mm-dd format. HTML <html> <head> <style> body { text-align: center; } </style> </head> <body> <h3>Setting Input Type Date in dd-mm-yyyy Format</h3> <label for="start"> Enter the Date: </label> <!-- Date input field --> <input type="date" name="begin" value="" min="1997-01-01" max="2030-12-31"> </body> </html> Output: input type date in dd-mm-yyyy format using HTML Example OutputIn this Examplemin="1997-01-01": This restricts the user to selecting dates from January 1, 1997.max="2030-12-31": This limits the user to selecting dates before December 31, 2030.placeholder="dd-mm-yyyy": This is just a visual hint, but the date format will not enforce dd-mm-yyyy. How to set input type date in dd-mm-yyyy format using HTML ? Comment More infoAdvertise with us Next Article How to Set Placeholder Value for Input Type Date in HTML? S shubhampatni88 Follow Improve Article Tags : Web Technologies HTML Write From Home HTML-Misc HTML-Questions +1 More Similar Reads How to Change input type="date" Format in HTML ? The <input> element with type="date" is used to allow the user to choose a date. By default, the date format displayed in the input field is determined by the user's browser and operating system settings. However, it is possible to change the format of the date displayed in the input field usi 4 min read How to Set Placeholder Value for Input Type Date in HTML? To set a placeholder value for the input type date in HTML5, use the placeholder attribute. The placeholder attribute doesn't work well with input type "date." Use onfocus="(this.type='date')" for a custom placeholder, enabling a date selection dropdown.Using OnfocusThe On-focus approach changes the 2 min read How to Set Placeholder Value for Input Type Date in HTML? To set a placeholder value for the input type date in HTML5, use the placeholder attribute. The placeholder attribute doesn't work well with input type "date." Use onfocus="(this.type='date')" for a custom placeholder, enabling a date selection dropdown.Using OnfocusThe On-focus approach changes the 2 min read How to format current date in MM/DD/YYYY HH:MM:SS format using JavaScript ? Given a date and the task is to format the current date in MM/DD/YYYY HH:MM:SS format. Here are a few of the most techniques discussed with the help of JavaScript. Approach 1: Store the current date in variable.Use the string concatenation technique to insert / and : in between the month-day and day 2 min read How to format current date in MM/DD/YYYY HH:MM:SS format using JavaScript ? Given a date and the task is to format the current date in MM/DD/YYYY HH:MM:SS format. Here are a few of the most techniques discussed with the help of JavaScript. Approach 1: Store the current date in variable.Use the string concatenation technique to insert / and : in between the month-day and day 2 min read How to add a date picker in form using HTML ? 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 picke 2 min read Like