The settings for the date, time, and time zone can be found in the Date and Time section of the System>Settings module within the Contao Back end. Each of these settings are formatted so that they can be parsed per the PHP date() function but are restricted in order to be displayed using UNIX timestamp requirements. In other words, the format for a date and time will appear per a specific standard. The UNIX standard means that you are limited to using only numeric date and time formats. For more information on these values, see the PHP manual for the PHP date function. The following tutorial explains how to find the Date and Time section in the System>Settings back end module and make changes to each value.
Adjusting the Date and Time Settings within Contao
- Login to the Contao Administrator Back end.
- Scroll down the left-hand side of the screen until you find the SYSTEM settings.
- Click on SETTINGS, then scroll to the Date and Time section near the top of the SETTINGS section. You will see a screen similar to the following:
The following table breaks down all of the abbreviations used for the Date and Time settings (note that these settings are case-sensitive):
|Letter Abbreviation||Definition||Numeric values|
||Date without leading zeros
||1 through 31
||Day of the month, 2 digits with leading zeros
||01 through 31
||Numeric representation of a month with leading zeros
||01 through 12
||Numeric representation of a month without leading zeros
||1 through 12
||Two-digit representation of a year
||example: 99 or 13
||Four-digit representation of a year
||example: 1999 or 2013
||12-hour format of an hour without leading zeros
||1 through 12
||24-hour format of an hour without leading zeros
||0 through 23
||12-hour format of an hour with leading zeros
||01 through 12
||24-hour format of an hour with leading zeros
||00 through 23
||Indicates if using daylight savings time
||1 if Daylight Savings time, 0 if not
||Seconds with leading zeros
||00 through 59
- Click on the Date Format field in order to change the format for a displayed date.
- Click on the Date and Time field format in order to change the format for a date displayed with time.
- Click on the Time Format field in order to change the format for a displayed time.
- Click on the drop-down menu in the Time zone field in order to select the appropriate time zone.
- Click on SAVE or SAVE AND CLOSE in the bottom left-hand corner in order save your entries.
Date and Time settings affect all entries being logged within Contao and where ever these values are being used. To see this change in action, we will show a portion of the System Log. The four-digit year and time has been changed to 12-hour with leading zeros. The year format change is easily seen, but the time entry can be best observed by looking at the second System Log screenshot. Under the entry noting the change in format, the time changes from 00:50 to 12:50.
|Time And Date settings||Screenshot of System Log|