DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:timezone

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:timezone [2014-08-08 04:23] – [Edit DokuWiki Conf] 167.88.103.34tips:timezone [2022-06-22 04:02] (current) – clarify that local.protected.php may need to be created, as I had to do for my wiki 96.241.231.169
Line 3: Line 3:
 ===== Edit DokuWiki Conf ===== ===== Edit DokuWiki Conf =====
  
-To set the correct timezone edit ''conf/local.protected.php'' and add the line:+To set the correct timezoneedit ''conf/local.protected.php'' or create it if it does not already exist. Add the line:
  
 <code php> <code php>
Line 9: Line 9:
 </code> </code>
  
-Make sure to put the modification after "<?php" if it was already there or just add it like this: +The modification goes after "<?php"if it is not already thereit can be added as follows 
-<code php>+<code php conf/local.protected.php>
 <?php <?php
 date_default_timezone_set("GMT"); date_default_timezone_set("GMT");
Line 17: Line 17:
 Note that if you modify ''conf/local.php'', your changes will be lost when you configure via the GUI. 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. +**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** 
-e.g. <code php>date_default_timezone_set('Asia/Kolkata');</code> for india. You may also try double quotes, if single quotes give a PHP warning...+ 
 +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 ===== ===== Edit PHP Conf =====
  
Line 27: Line 32:
 Uncomment the '';date.timezone = '' line and add your timezone. Uncomment the '';date.timezone = '' line and add your timezone.
  
-  date.timezone = America/Chicago+<code ini> 
 +date.timezone = America/Chicago 
 +</code>
  
 Then reload PHP to make the change take effect. Then reload PHP to make the change take effect.
Line 37: Line 44:
 The PHP site lists the [[http://us.php.net/timezones|available timezones]]. The PHP site lists the [[http://us.php.net/timezones|available timezones]].
  
-For example, if you live in Chicago, replace GMT with "America/Chicago."+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://github.com/Comicslate/Userscripts/blob/master/Comicslate/TimeFix.user.js 
 + 
 +It would be nice to make a plugin to request a timezone in a user profile and store this parameter in a cookie
tips/timezone.1407464626.txt.gz · Last modified: 2014-08-08 04:23 by 167.88.103.34

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