Default to UTC when no timezone set so that montagereview continues working. Fixes #3274
This commit is contained in:
parent
ed5262432f
commit
9a03c2c16a
|
@ -1,6 +1,12 @@
|
||||||
|
|
||||||
var server_utc_offset = <?php
|
var server_utc_offset = <?php
|
||||||
$TimeZone = new DateTimeZone( ini_get('date.timezone') );
|
$tz = ini_get('date.timezone');
|
||||||
|
if (!$tz) {
|
||||||
|
$tz = 'UTC';
|
||||||
|
Warning('Timezone has not been set. Either select it in Options->System->Timezone or in php.ini');
|
||||||
|
}
|
||||||
|
|
||||||
|
$TimeZone = new DateTimeZone($tz);
|
||||||
$now = new DateTime('now', $TimeZone);
|
$now = new DateTime('now', $TimeZone);
|
||||||
$offset = $TimeZone->getOffset($now);
|
$offset = $TimeZone->getOffset($now);
|
||||||
echo $offset.'; // '.floor($offset / 3600).' hours ';
|
echo $offset.'; // '.floor($offset / 3600).' hours ';
|
||||||
|
|
Loading…
Reference in New Issue