1
 $( "#datepicker1, #datepicker2" ).datepicker(
 {dateFormat: 'dd/mm/yy'}).val();
           and
$( "#datepicker1, #datepicker2" ).datepicker('option', 'dateFormat', 'dd-mm-yy');


<div class="date1"> 
  <label>From Date :</label>                       
  <input type="text" required="" placeholder="Select From Date" name="fromdate1" id="datepicker1">          
</div>
<div class="date1">  
  <label>To Date :</label>                       
  <input type="text" required="" placeholder="Select To Date" name="todate1" id="datepicker2">                 
</div>

When i'm using the above code,it shows the date in 12/16/2013 format.How do i get the date in 16/12/2013 ? Kindly do me a favour.

Keerthi
  • 117
  • 1
  • 2
  • 10

1 Answers1

1

Try this Stack overflow question

var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' }).val();

More general info available here:

Community
  • 1
  • 1
Hiren Kagrana
  • 912
  • 8
  • 21
  • If you find a similar question on stack overflow, please mark it as duplicate rather then sharing the link of question and posting it as answer. – Sid M Jul 08 '14 at 08:40
  • sorry i'm getting the same result...i didn't get my desired format – Keerthi Jul 08 '14 at 08:45
  • var pickerOpts = { dateFormat:"dd/mm/yy" }; $( "#datepicker1" ).datepicker(pickerOpts); var pickerOpts1 = { dateFormat:"dd/mm/yy" }; $( "#datepicker2" ).datepicker(pickerOpts1); i can convert it by using the above code.... :) – Keerthi Jul 08 '14 at 11:35