I am using jquery datetime picker. it is showing date in "yy/MMM/dd 开发者_如何学Gohh: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"
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' );
After initializing the datepicker
$('#selector').datepicker();
you could do
$('#selector').datepicker('option', 'dateFormat', 'dd-mm-y');
See THIS for possible formats
$(function(){
var pickerOpts = {
dateFormat:"d MM yy"
};
$("#date").datepicker(pickerOpts);
});
精彩评论