DHTMLX Docs & Samples Explorer

setDateFormat(format)

Sets date format.

Parameters:

  • format - the custom date format string.

    myCalendar.setDateFormat("%d/%m/%y");

Description:

Format string can contain any separator character and any element from the following list:

  • %d - day as number ( with leading zero );
  • %j - day as number;
  • %D - abbreviated name of the day;
  • %l - full name of the day;
  • %m - month as number ( with leading zero );
  • %n - month as number;
  • %M - abbreviated name of the month;
  • %F - full name of the month;
  • %y - year as number (2 digits);
  • %Y - year as number (4 digits);
  • %h - hours (12);
  • %H - hours (24);
  • %i - minutes;
  • %s - seconds;
  • %a - am or pm;
  • %A - AM or PM.

For example, if you want to set 1st June 2011 as 01.06.2011, the following format should be specified:

myCalendar.setDateFormat("%d.%m.%Y");

See also: