-1

How can I get the date format in dd/mm/yyyy format?

<!doctype html>

<html>
<head>
<title>jQuery Datepicker UI Example - Demo Preview</title>
<meta name="robots" content="noindex, nofollow"/>
<!------------ Including jQuery Date UI with CSS -------------->
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<!-- jQuery Code executes on Date Format option ----->
<script src="js/script.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<h2>jQuery Datepicker UI Example Form</h2>
<div class="main">
<form action="" method="post">
<label>Name :</label>
<input type="text" name="sname" id="Name"/>
<label>Date Of Birth :</label>
<input type="text" name="selected_date" id="datepicker"/>
<input type="submit" id="submit" value="Submit">
</form>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function() {
// Datepicker Popups calender to Choose date.
$(function() {
$("#datepicker").datepicker();
// Pass the user selected date format.
});
});
</script>
jub0bs
  • 60,866
  • 25
  • 183
  • 186
yadav
  • 21
  • 4

1 Answers1

0
<script>


$(function() {
$("#datepicker").datepicker({dateFormat: "dd/mm/yyyy"});

});

</script>
Ankur Bhadania
  • 4,123
  • 1
  • 23
  • 38