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 |
j |
Date without leading zeros |
1 through 31 |
d |
Day of the month, 2 digits with leading zeros |
01 through 31 |
m |
Numeric representation of a month with leading zeros |
01 through 12 |
n |
Numeric representation of a month without leading zeros |
1 through 12 |
y |
Two-digit representation of a year |
example: 99 or 13 |
Y |
Four-digit representation of a year |
example: 1999 or 2013 |
g |
12-hour format of an hour without leading zeros |
1 through 12 |
G |
24-hour format of an hour without leading zeros |
0 through 23 |
h |
12-hour format of an hour with leading zeros |
01 through 12 |
H |
24-hour format of an hour with leading zeros |
00 through 23 |
I |
Indicates if using daylight savings time |
1 if Daylight Savings time, 0 if not |
s |
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 |
|
|
|
|
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!