Is there any way to change input type=“date” format?

I was working with one of my projects when I came across with an interesting question.

As we know, by default input type="date" shows date as YYYY-MM-DD.

Is it possible to change its format to something like: DD-MM-YYYY?

There is no way possible to change the format

We have to differentiate between the over the wire format and the browser’s presentation format.

Wire format The HTML5 date input specification [1] refers to the RFC3339 specification [2], which specifies a full-date format equal to: yyyy-mm-dd. See section 5.6 of the RFC3339 specification for more details.

Presentation format Browsers are unrestricted in how they present a date input. At the time of writing Chrome has the most extensive date support [3]. It displays a date picker using the user’s local calendar format. Opera (v10.6+) also displays a date picker, but shows the date in the wire format. Other browsers, such as Firefox 24 and Internet Explorer 9/10 display a text input field with the wire format.

References

  1. http://www.w3.org/TR/html-markup/input.date.html
  2. http://tools.ietf.org/html/rfc3339
  3. https://plus.google.com/102860501900098846931/posts/hTcMLVNKnec

Tural Aliyev

I'm traveloholic, musicphile, technoholic, cinephile, workaholic software developer

Istanbul http://tural.us

Subscribe to Tural's Notebook

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!