1.20.x utility.inc | views_get_timezone() |
Figure out what timezone we're in; needed for some date manipulations.
File
- modules/
views/ includes/ utility.inc, line 310 - Utility functions for assembling Views queries.
Code
function views_get_timezone() {
$timezone = backdrop_get_user_timezone();
// set up the database timezone
$offset = '+00:00';
static $already_set = FALSE;
if (!$already_set) {
Database::getConnection('default')->setSessionTimezoneOffset($offset);
$already_set = true;
}
return $timezone;
}