WCF now uses server timezone as the default timezone
authorMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 18:28:26 +0000 (20:28 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 18:28:26 +0000 (20:28 +0200)
wcfsetup/install/files/acp/install.php

index 96007cf93822971e070a974de89cc19217a1826e..81a99161501edca5e2a6df28811b09ba43652e6c 100644 (file)
@@ -65,3 +65,14 @@ LanguageEditor::deleteLanguageFiles();
 
 // delete all compiled templates
 ACPTemplateEngine::deleteCompiledTemplates(WCF_DIR.'acp/templates/compiled/');
+
+// get server timezone
+if ($timezone = @date_default_timezone_get()) {
+       if ($timezone != 'Europe/London' && in_array($timezone, \wcf\util\DateUtil::getAvailableTimezones())) {
+               $sql = "UPDATE  wcf".WCF_N."_option
+                       SET     optionValue = ?
+                       WHERE   optionName = ?";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute(array($timezone, 'timezone'));
+       }
+}