I am using jquery datetime picker. it is showing date in "yy/MMM/dd hh:mm:ss"
format on selecting the date and time. i am not able to change its format. How can i change it to my custom format "dd/MM/yyyy hh:mm"
views:
93answers:
3
+3
A:
You can set it at initialization like this:
$([selector]).datepicker({
dateFormat: "dd/MM/yyy hh:mm"
});
Or you can set the date format after initialization using the following code:
$( ".selector" ).datepicker( "option", "dateFormat", 'yy-mm-dd' );
Emil Badh
2010-10-06 08:26:50
i m using datetime picker as shown in this example not the datepicker as shown here http://rohitaggarwal.wordpress.com/2009/05/22/jquery-calendar-date-time-picker/
Tassadaque
2010-10-06 09:57:55
In that case there's both bad and good news. The bad is that that particular date picker does not have support for setting the date format. The good news is that at http://blog.w3visions.com/2009/04/date-time-picker-with-jquery-ui-datepicker/#comment-61 someone has written how to implement support for setting the date time format.
Emil Badh
2010-10-06 11:39:57
A:
$(function(){
var pickerOpts = {
dateFormat:"d MM yy"
};
$("#date").datepicker(pickerOpts);
});
Zinab Taher
2010-10-21 10:34:57