is there any input date format mm-dd-yyyy change to dd-mm-yyyy?

For Chrome, Firefox, and Opera, the formatting of the input field’s text is based on the browser’s language setting. For Edge, it is based on the Windows language setting. but, all web browsers ignore the date formatting configured in the operating system. this is very strange behavior, and something to consider when using this input type. For example, Dutch users that have their operating system or browser language set to en-us will be shown 01/30/2019 instead of the format they are accustomed to 30-01-2019.

Internet Explorer 9, 10, and 11 display a text input field with the wire format.

Mobile devices

Specifically for Chrome on Android, the formatting is based on the Android display language.


<script src=""></script>
<div class="date-selector">
  <input id="datePicker" class="form-control" type="date" onkeydown="return false" />
  <span id="datePickerLbl" style="pointer-events: none;"></span>


.date-selector {
  position: relative;

.date-selector>input[type=date] {
  text-indent: -500px;


$("#datePicker").on("change", function(e) {

  displayDateFormat($(this), '#datePickerLbl', $(this).val());


function displayDateFormat(thisElement, datePickerLblId, dateValue) {

  $(thisElement).css("color", "rgba(0,0,0,0)")
      position: "absolute",
      left: "10px",
      top: "3px",
      width: $(this).width()
    .text(dateValue.length == 0 ? "" : (`${getDateFormat(new Date(dateValue))}`));


function getDateFormat(dateValue) {

  let d = new Date(dateValue);

  // this pattern dd/mm/yyyy
  // you can set pattern you need
  let dstring = `${("0" + d.getDate()).slice(-2)}/${("0" + (d.getMonth() + 1)).slice(-2)}/${d.getFullYear()}`;

  return dstring;

Another way to change Date Format


<script src=""></script>
<script src=""></script>
<input type="date" data-date="" data-date-format="DD MMMM YYYY" value="2015-08-09">


input {
    position: relative;
    width: 150px; height: 20px;
    color: white;

input:before {
    position: absolute;
    top: 3px; left: 3px;
    content: attr(data-date);
    display: inline-block;
    color: black;

input::-webkit-datetime-edit, input::-webkit-inner-spin-button, input::-webkit-clear-button {
    display: none;

input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 3px;
    right: 0;
    color: black;
    opacity: 1;


$("input").on("change", function() {
        moment(this.value, "YYYY-MM-DD")
        .format( this.getAttribute("data-date-format") )

Related Posts

One thought on “is there any input date format mm-dd-yyyy change to dd-mm-yyyy?

Leave a Reply

Your email address will not be published. Required fields are marked *