This is an old revision of the document!
Table of Contents
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.
ATTENTION: This may cause the RSS feed to crash, in which it will flood updates every <set option> minutes for X hours in a row by a time shift of X hours east, and updates will not be considered fresh immediately after a posting by a time shift west
For changing time zone on linux shared hosting - dokuWiki/inc/init.php - search “date_default_timezone_set” (line #93 for Greebo build) - 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…
ATTENTION: This may cause the RSS feed to crash, in which it will flood updates every <set option> minutes for X hours in a row by a time shift of X hours east, and updates will not be considered fresh immediately after a posting by a time shift west
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”.
Timezones for users
I use this for my UTS+10 timezone (look at “shift” var) and posted a link on my site for readers https://greasyfork.org/ru/scripts/384537-comicslate-timefix
It would be nice to make a plugin to request a timezone in a user profile and store this parameter in a cookie