Reputation: 289
Im using bootstrap datetime picker Bootstarp picker
how can i change default date and time format.
I have tried dateFormat: 'dd-mm-yy', format: 'yyyy-mm-dd hh:ii',dateFormat: 'yymmdd' in
$('.datetimepicker').datetimepicker({
dateFormat: 'yymmdd',
timeFormat: 'hhmm'
});
But none of them seem to work. Please help i want change the dateFormat to yy-mm-dd and time format to HH:mm:ss
Upvotes: 0
Views: 9416
Reputation: 763
Try like below
$('.datetimepicker').datetimepicker({
format: 'yyyy-dd-mm',
});
Upvotes: 0
Reputation: 1
YYYY-MM-DD hh:mm:ss
did not work for me.
The following did though:
$( function() {$( "#datetimepicker" ).datetimepicker({ format: "d-m-y H:i" });} );
Upvotes: 0
Reputation: 716
You will need to set the format
option with a valid moment format
$('.datetimepicker').datetimepicker({
format: 'YYYY-MM-DD hh:mm:ss'
});
Upvotes: 1