mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17405] Fix getting UTC date/time information logic
PHPBB-17405
This commit is contained in:
parent
d8dc1204c2
commit
990cbe093b
1 changed files with 11 additions and 3 deletions
|
@ -107,9 +107,17 @@ function phpbb_gmgetdate($time = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// getdate() interprets timestamps in local time.
|
// getdate() interprets timestamps in local time.
|
||||||
// What follows uses the fact that getdate() and
|
// So use UTC timezone temporarily to get UTC date info array.
|
||||||
// date('Z') balance each other out.
|
$current_timezone = date_default_timezone_get();
|
||||||
return getdate($time - date('Z'));
|
|
||||||
|
// Set UTC timezone and get respective date info
|
||||||
|
date_default_timezone_set('UTC');
|
||||||
|
$date_info = getdate($time);
|
||||||
|
|
||||||
|
// Restore timezone back
|
||||||
|
date_default_timezone_set($current_timezone);
|
||||||
|
|
||||||
|
return $date_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue