You are able to alter the Time Zone setting for your Drupal site within the Admin area. In fact, users are also able to alter the Time Zone for their specific accounts as well. This is helpful because the dates that are displayed across the site on articles, log posts, comments, etc. will be relevant to the visitor’s local time. Check out the quick guide below as we show you how to change the Time Zones in Drupal.
Transfer your website for better performance now with our Drupal Hosting platform.
How to change the time zone setting in Drupal
- Log into the Drupal 8 admin interface.
- Using the top menu bar, click on the Menu option.
- This leads to a second menu bar appearing under the first. From here, click on the Configuration tab.
- Look for the Regional and Language category and then click on the Regional Settings option.
- Here you will see a dropdown from which you will select your site’s default time zone.
- Once you have selected the preferred time zone, click on the Save Configuration button at the bottom to activate your changes. Below is a couple of shots that demonstrate how the time display changes. The first is when the setting is for American West Coast time, and the second is when it is set to American East Coast time.
Before After
Giving the user their own time zone
In addition to setting your time zone for the site, there is a checkbox named Users may set their own time zone which you can activate to allow users to have their own time zone. By selecting this checkbox, other options will appear that you can use to tailor the user’s experience as well.
Users may set their own time zone | This box MUST be checked for any of the other options to appear | ||||||
---|---|---|---|---|---|---|---|
Remind users at login if their time zone is not set | If this is checked, the user will be reminded at login to set their own time zone. If they do not, then the default will be used | ||||||
Time Zone for new users | These options will set the time zone for new members according to the following radio buttons:
|
On a fully updated Drupal 8/CiviCRM 5 running on CentOS 7, using MariaDB 10 with a fairly standard setup:
$ mysql_tzinfo_to_sql /usr/share/zoneinfo/right |mysql -u root mysql -p
Was the only solution, which I could figure out, that worked. Following this timezone file path update, the time zone in CiviCRM matched the timezone I’m in. I think the default MariaDB setup simply uses a path that doesn’t match CentOS’ timezone file location.
-Neil