Date format in Bootstrap datetimepicker

rb vishnu picture rb vishnu · Jul 24, 2014 · Viewed 91.5k times · Source

I am just working on Bootstrap datetimepicker, and I am done that. A small problem is there, I tried to change the selected date format and failed. How can I fix this?

This is my code:

$('.datepicker').datetimepicker({
    dateFormat: "dd-mm-yy", 
    timeFormat: "HH:mm:ss"
});

This is my jsfiddle link http://jsfiddle.net/vishnur15/8tsCt/2/

Answer

Se0ng11 picture Se0ng11 · Jul 24, 2014

check this jsfiddle

http://jsfiddle.net/8tsCt/4/ --not working due to reference link broken

latest version as per 2017

http://jsfiddle.net/8tsCt/166/

format must be

$('.datepicker').datetimepicker({
    format: 'DD-MM-YYYY HH:mm:ss'
});