currently arrival date and departure date format is m/d/y..can i change the date format to d/m/y??

<html>
<head>
  <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>

  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker();
    $("#datepicker2").datepicker();
  });
  </script>
</head>
<body>

<form method="post" action="4.php">

arrival date    <input type="textbox6" name="arrivaldate[]" id="datepicker"><br>
departure date  <input type="textbox7" name="departuredate[]" id="datepicker2"><br>



<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

Recommended Answers

If you're referring to the datepicker then yes, use dateFormat:

$("#datepicker").datepicker({
    dateFormat: 'dd-mm-yy'
});

Documentation:

Jump to Post

All 2 Replies

The link that you suggest is very helpful. Here's the correct code. Change the script part to this.

  <script>
  $(document).ready(function() {
    $("#datepicker").datepicker({ dateFormat: "dd/mm/yy" });
    $("#datepicker2").datepicker({ dateFormat: "dd/mm/yy" });

  });
  </script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.