DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:timezone

This is an old revision of the document!


Setting TimeZone

Edit DokuWiki Conf

To set the correct timezone edit conf/local.protected.php and add the line:

date_default_timezone_set("GMT");

Make sure to put the modification after “<?php” if it was already there or just add it like this:

conf/local.protected.php
<?php
date_default_timezone_set("GMT");

Note that if you modify conf/local.php, your changes will be lost when you configure via the GUI.

For changing time zone on linux shared hosting - dokuWiki/inc/init.php - Line no 88 - Set you own time zone. e.g. date_default_timezone_set('Asia/Kolkata'); for india. You may also try double quotes, if single quotes give a PHP warning…

Edit PHP Conf

Alternatively, edit the php.ini file.

For example, in Ubuntu edit /etc/php5/fpm/php.ini.

Uncomment the ;date.timezone = line and add your timezone.

date.timezone = America/Chicago

Then reload PHP to make the change take effect.

/etc/init.d/php5-fpm reload

Timezones

The PHP site lists the available timezones.

For example, if you live in Chicago, replace GMT with “America/Chicago”.

tips/timezone.1511788440.txt.gz · Last modified: 2017-11-27 14:14 by thekeymaster

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki