\PhpOffice\PhpSpreadsheet\SharedTimeZone

Summary

Methods
Properties
Constants
setTimeZone()
getTimeZone()
getTimeZoneAdjustment()
No public properties found
No constants found
No protected methods found
$timezone
N/A
validateTimeZone()
No private properties found
N/A

Properties

$timezone

$timezone : string

Default Timezone used for date/time conversions.

Type

string

Methods

setTimeZone()

setTimeZone(string  $timezone) : boolean

Set the Default Timezone used for date/time conversions.

Parameters

string $timezone

Time zone (e.g. 'Europe/London')

Returns

boolean —

Success or failure

getTimeZone()

getTimeZone() : string

Return the Default Timezone used for date/time conversions.

Returns

string —

Timezone (e.g. 'Europe/London')

getTimeZoneAdjustment()

getTimeZoneAdjustment(string  $timezone, integer  $timestamp) : integer

Return the Timezone offset used for date/time conversions to/from UST This requires both the timezone and the calculated date/time to allow for local DST.

Parameters

string $timezone

The timezone for finding the adjustment to UST

integer $timestamp

PHP date/time value

Throws

\PhpOffice\PhpSpreadsheet\Exception

Returns

integer —

Number of seconds for timezone adjustment

validateTimeZone()

validateTimeZone(string  $timezone) : boolean

Validate a Timezone name.

Parameters

string $timezone

Time zone (e.g. 'Europe/London')

Returns

boolean —

Success or failure