class TimeZone (View source)

Properties

static protected string $timezone Default Timezone used for date/time conversions.

Methods

static bool
setTimeZone(string $timezone)

Set the Default Timezone used for date/time conversions.

static string
getTimeZone()

Return the Default Timezone used for date/time conversions.

static int
getTimeZoneAdjustment(string $timezone, int $timestamp)

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.

Details

static bool setTimeZone(string $timezone)

Set the Default Timezone used for date/time conversions.

Parameters

string $timezone Time zone (e.g. 'Europe/London')

Return Value

bool Success or failure

static string getTimeZone()

Return the Default Timezone used for date/time conversions.

Return Value

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

static int getTimeZoneAdjustment(string $timezone, int $timestamp)

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

Return Value

int Number of seconds for timezone adjustment

Exceptions

Exception