rb vishnu rb vishnu - 1 year ago 32
Javascript Question

Date format in Bootstrap datetimepicker

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 Source

check this jsfiddle

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

format must be

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