Nextcloud PHP API (master)

IDateTimeZone

Interface IDateTimeZone

Tags
since
8.0.0

Table of Contents

Methods

getDefaultTimeZone()  : DateTimeZone
Get the timezone configured as the default for this Nextcloud server.
getTimeZone()  : DateTimeZone
Get the timezone for a given user.

Methods

getDefaultTimeZone()

Get the timezone configured as the default for this Nextcloud server.

public getDefaultTimeZone() : DateTimeZone

While the PHP timezone is always set to UTC in Nextcloud this is the timezone to use for all time offset calculations if no user value is specified.

Tags
since
32.0.0
Return values
DateTimeZone

getTimeZone()

Get the timezone for a given user.

public getTimeZone([bool|int $timestamp = false ][, string|null $userId = null ]) : DateTimeZone

If a timestamp is passed the timezone for that given timestamp is retrieved (might differ due to DST). If no userId is passed the current user is used.

Parameters
$timestamp : bool|int = false
$userId : string|null = null
  • The user to fetch the timezone for (defaults to current user)
Tags
since
8.0.0
since
8.1.0
  • parameter $timestamp was added
since
32.0.0
  • parameter $userId was added
Return values
DateTimeZone

        
On this page

Search results