mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 20:49:08 +01:00
Set timezone in PHP too
This commit is contained in:
parent
88a3f3b1d4
commit
7ac36666c5
@ -19,6 +19,8 @@ use Egroupware\Api;
|
|||||||
|
|
||||||
class TimezoneTest extends \EGroupware\Api\AppTest {
|
class TimezoneTest extends \EGroupware\Api\AppTest {
|
||||||
|
|
||||||
|
protected static $server_tz;
|
||||||
|
|
||||||
protected $bo;
|
protected $bo;
|
||||||
|
|
||||||
const RECUR_DAYS = 5;
|
const RECUR_DAYS = 5;
|
||||||
@ -29,9 +31,13 @@ class TimezoneTest extends \EGroupware\Api\AppTest {
|
|||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
|
static::$server_tz = date_default_timezone_get();
|
||||||
}
|
}
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
|
date_default_timezone_set(static::$server_tz);
|
||||||
|
|
||||||
parent::tearDownAfterClass();
|
parent::tearDownAfterClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,6 +342,7 @@ class TimezoneTest extends \EGroupware\Api\AppTest {
|
|||||||
protected function setTimezones($timezones)
|
protected function setTimezones($timezones)
|
||||||
{
|
{
|
||||||
// Set the client preference & server preference
|
// Set the client preference & server preference
|
||||||
|
date_default_timezone_set($timezones['server']);
|
||||||
$GLOBALS['egw_info']['server']['server_timezone'] = $timezones['server'];
|
$GLOBALS['egw_info']['server']['server_timezone'] = $timezones['server'];
|
||||||
$GLOBALS['egw_info']['user']['preferences']['common']['tz'] = $timezones['client'];
|
$GLOBALS['egw_info']['user']['preferences']['common']['tz'] = $timezones['client'];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user