How to change date format in html

Question:

In HTML, I am date type, but it’s giving me yyyy-mm-dd. I want to use dd-mm-yyyy format.
Can anyone give me a suggestion?

<fieldset style = "font-size:15px;">
        <input type="date" name = "fromdate" placeholder = "FROM: DD-MM-YYYY" />
      </fieldset>
         {% comment %} <option value="2P">2P</option> {% endcomment %}
         <fieldset style = "font-size:15px;">
          <input type="date" name = "todate" placeholder = "FROM: DD-MM-YYYY" />
        </fieldset>
Asked By: code

||

Answers:

Quoting from MDN docs:

Note: The displayed date format will differ from the actual value —
the displayed date is formatted based on the locale of the user’s
browser, but the parsed value is always formatted yyyy-mm-dd.

Answered By: TactlessBlanket
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.