Date Time Formats
Security covered
This project adds a set of pre-defined date and time formats to your Drupal site to cover common display needs. It also allows for customization of short date and time formats, and updates core Drupal date formats.
Date and Time Formats is a recipe that creates the following date formats (shown with example defaults) for common needs:
- Long (January 31, 2026)
- Long with day (Saturday, January 31, 2026)
- Long with day and time (Saturday, January 31, 2026 - 15:46)
- Long with time (January 31, 2026 - 15:46)
- Long yearless (January 31)
- Medium (Jan 31, 2026)
- Medium with day (Sat, Jan 31, 2026)
- Medium with day and time (Sat, Jan 31, 2026 - 15:46)
- Medium with time (Jan 31, 2026 - 15:46)
- Medium yearless (Jan 31)
- Short (31/1/26)
- Short with day and time (Sat, 31/1/26 - 15:46)
- Short with time (31/1/26 - 15:46)
- Short yearless (31/1)
- Time only (15:46)
The following customizations are available when the recipe is applied from the command line:
- Format for short dates: separator, order of month and day, 2-digit or 4-digit year (Default: d/m/yy)
- Format for times: 12-hour format with am/pm or 24-hour format (Default: 24-hour format)
The following date formats provided by Drupal core are updated and relabeled:
- Default long date
- Default medium date
- Default short date