dateFormat

dateFormat

I have a calendar which sends a date picked by a user to a database, this works fine.  The date format in the database is day, date,month, year (fri, 30 December 2016). I then have this date displayed on a web page but the format is mm, dd, yy.  Theres is an option for a user to select a date format:

$( function() {
    $( "#datepicker" ).datepicker();
    $( "#format" ).on( "change", function() {
      $( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() );
        });
    });

However, this is not what I want.  I want the displayed date the same format as the one in the database.

Can any one help?

Stephen