lithium\data\source\database\adapter\PostgreSql::timezone()
Getter/Setter for the connection's timezone.
Parameters
-
null|string
$timezone
Either
null
to retrieve the current TZ, or a string to set the current TZ to.
Returns
string|booleanWhen $timezone is null
returns the current TZ
in effect, otherwise a boolean indicating if setting the TZ
succeeded or failed.
Source
public function timezone($timezone = null) {
if ($timezone === null) {
return $this->connection->query('SHOW TIME ZONE')->fetchColumn();
}
return $this->connection->exec("SET TIME ZONE '{$timezone}'") !== false;
}