Back to Date class

Method getOffsetFromGmt

public float
getOffsetFromGmt
(mixed $hours = false)
Get the time offset from GMT in hours or seconds.
Parameters
  • bool $hours True to return the value in hours.
Returns
  • float The time offset from GMT either in hours or in seconds.
Since
  • 1.7.0
Class: Date
Project: Joomla

Method getOffsetFromGmt - Source code

/**
 * Get the time offset from GMT in hours or seconds.
 *
 * @param   boolean  $hours  True to return the value in hours.
 *
 * @return  float  The time offset from GMT either in hours or in seconds.
 *
 * @since   1.7.0
 */
public function getOffsetFromGmt($hours = false)
{
    return (float) $hours ? $this->tz->getOffset($this) / 3600 : $this->tz->getOffset($this);
}
OSZAR »