1 date.module date_default_format($type)

Gets the default date format for the given field widget.

Parameters

string $type: The widget type whose default format should be returned.

File

core/modules/date/date.module, line 16
Defines date/time field types.

Code

function date_default_format($type) {
  // Example input formats must show all possible date parts, so add seconds.
  $shortformat = system_date_format_load('short');
  $default_format = str_replace('i', 'i:s', $shortformat['pattern']);
  return $default_format;
}