\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) : bool

Set the Default Timezone used for date/time conversions.

Parameters

string $timezone

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

Returns

bool —

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, int  $timestamp) : int

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

int $timestamp

PHP date/time value

Returns

int —

Number of seconds for timezone adjustment

validateTimeZone()

validateTimeZone(string  $timezone) : bool

Validate a Timezone name.

Parameters

string $timezone

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

Returns

bool —

Success or failure