DateTimeZone

class OC\DateTimeZone
Source:lib/private/DateTimeZone.php#33
Implements:OCP\IDateTimeZone

Properties

protected static property OC\DateTimeZone::$config
Source:lib/private/DateTimeZone.php#35
Type:\OCP\IConfig
protected static property OC\DateTimeZone::$session
Source:lib/private/DateTimeZone.php#38
Type:\OCP\ISession

Methods

public OC\DateTimeZone::__construct($config, $session)
Constructor
Source:

lib/private/DateTimeZone.php#46

Parameters:
public OC\DateTimeZone::getTimeZone($timestamp=false)
Get the timezone of the current user, based on his session information and config data
Source:

lib/private/DateTimeZone.php#57

Parameters:
  • $timestamp (bool | int)
Returns:

\DateTimeZone

protected OC\DateTimeZone::guessTimeZoneFromOffset($offset, $timestamp)
Guess the DateTimeZone for a given offset
We first try to find a Etc/GMT* timezone, if that does not exist,
we try to find it manually, before falling back to UTC.
Source:

lib/private/DateTimeZone.php#84

Parameters:
  • $offset (mixed)
  • $timestamp (bool | int)
Returns:

\DateTimeZone

protected OC\DateTimeZone::getDefaultTimeZone()
Get the default timezone of the server
Falls back to UTC if it is not yet set.
Source:lib/private/DateTimeZone.php#126
Returns:string