mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-01 20:19:13 +02:00
Merge pull request #6726 from rxu/ticket/17405
[ticket/17405] Fix getting UTC date/time information logic
This commit is contained in:
commit
283b4f8171
@ -107,9 +107,17 @@ function phpbb_gmgetdate($time = false)
|
||||
}
|
||||
|
||||
// getdate() interprets timestamps in local time.
|
||||
// What follows uses the fact that getdate() and
|
||||
// date('Z') balance each other out.
|
||||
return getdate($time - date('Z'));
|
||||
// So use UTC timezone temporarily to get UTC date info array.
|
||||
$current_timezone = date_default_timezone_get();
|
||||
|
||||
// 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…
x
Reference in New Issue
Block a user