title: How to change the date format of datepicker using jquery?
body: <p>I am using datepicker in jqgrid. Here, I want to get the date in the format of dd-mm-yy and i want to save the date on database in the format of yyyy-MM-dd HH:mm:ss. And whenever i retrieve date from database i will be in the format of dd-mm-yy.</p>
  
  <p>How should we make it using jquery?</p>
  
  <p><strong>Update</strong></p>
  
  <pre><code>&lt;script&gt;
              datePick=function(element)
                  {
                      $(element).datepicker(
                          {
                              buttonImage: "calendar.gif",
                              buttonImageOnly: true,
                              minDate: 0,
                              showButtonPanel: true ,
                              closeText: "Close",                                 
                              changeMonth: true,
                              changeYear: true
                          }
                      ).attr('readonly','true');
                  };
              function callme()
              {
  
                  $( "#datepicker" ).datepicker( "option", "dateFormat", 'dd-mm-yy' );
  
              }
  
              function call()
              {
  
                  $( "#datepicker" ).datepicker( "option", "dateFormat", 'dd-mm-yy' );
              }
  
              function fun()
              {
                  $( "#datepicker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' );
              }
  &lt;/script&gt;
  &lt;body&gt;
              &lt;sjg:grid id="gridtable"
              ..............
              &gt;
              .
              .
              .
              .
              .
                   &lt;sjg:gridColumn
                  name="custEstdDate"
                  align="left"
                  index="custEstdDate"
                  title="Estd Date"
                  sortable="false"
                  editable="true"
                  editoptions="{
                      size: 20,
                      maxlength: 10,
                      dataInit:datePick
                  }"
                 edittype="text"/&gt;
                 &lt;/sjg:grid&gt;
  </code></pre>
  
  <p>These are my sample coding...</p>