function date_sql_handler::get_offset in Date 7
Same name and namespace in other branches
- 5.2 date_api_sql.inc \date_sql_handler::get_offset()
- 6.2 date_api_sql.inc \date_sql_handler::get_offset()
- 6 date_api_sql.inc \date_sql_handler::get_offset()
- 7.3 date_api/date_api_sql.inc \date_sql_handler::get_offset()
- 7.2 date_api/date_api_sql.inc \date_sql_handler::get_offset()
Return timezone offset for the date being processed.
1 call to date_sql_handler::get_offset()
- date_sql_handler::sql_tz in date_api/
date_api_sql.inc - Select a date value from the database, adjusting the value for the timezone.
File
- date_api/
date_api_sql.inc, line 145 - SQL helper for Date API.
Class
- date_sql_handler
- A class to manipulate date SQL.
Code
function get_offset() {
if (!empty($this->db_timezone) && !empty($this->local_timezone)) {
if ($this->db_timezone != $this->local_timezone) {
$date = date_now($this->db_timezone);
$date
->setTimezone(timezone_open($this->local_timezone));
return date_offset_get($date);
}
}
return 0;
}