Browse Source

Fix some minor timezone weirdness

This mostly ensures cron jobs run under UTC time if php.ini has no timezone set or is set to a non-UTC timezone.
Alan Hardman 2 years ago
parent
commit
8bb8d330fb
2 changed files with 2 additions and 2 deletions
  1. 1 2
      app/model/user.php
  2. 1 0
      cron/base.php

+ 1 - 2
app/model/user.php

@@ -231,8 +231,7 @@ class User extends \Model {
 	 * @return array
 	 */
 	public function stats($time = 0) {
-		\Helper\View::instance()->utc2local();
-		$offset = \Base::instance()->get("site.timeoffset");
+		$offset = \Helper\View::instance()->timeoffset();
 
 		if(!$time) {
 			$time = strtotime("-2 weeks", time() + $offset);

+ 1 - 0
cron/base.php

@@ -18,6 +18,7 @@ $f3->mset(array(
 	"LOGS" => $homedir."log/",
 	"AUTOLOAD" => $homedir."app/;".$homedir."lib/vendor/",
 	"TEMP" => $homedir."tmp/",
+	"TZ" => "UTC",
 ));
 
 // Load local configuration