Search code examples
javascriptjqueryjquerydatetimepicker

jQuery datetimepicker - Date formatting not working


I am using jQuery datetimepicker plugin from this site.

I would like to format the date in format DD.MM.YYYY but in spite of setting below, when I pick the value from calendar it's still formatted as YYYY/MM/DD:

jQuery('#inputdHACC_DST').datetimepicker(
{
    dateFormat: 'dd-mm-yy',
    timeFormat: 'HH:mm'
});

Is it possible to format date value like DD/MM/YYYY and override the default?


Solution

  • Change dateFormat to format

    jQuery('#inputdHACC_DST').datetimepicker(
    {
        format: 'd.m.Y H:i'
    });