Documentation

TimeZones
in package

Utilities for Windows timezones - which is straight up bonkers.

Tags
link
https://github.com/unicode-org/cldr/blob/main/common/supplemental/windowsZones.xml

Table of Contents

Properties

$map  : array<string|int, mixed>|null

Methods

fromIana()  : null|string
Translate from IANA to Windows timezones.
fromWindows()  : null|string
Translate between Windows and IANA timezones.
getIanaMap()  : array<string, string>
Get a map of IANA timezones to Windows timezones.
getMap()  : array<string, string>
Get a map of Windows timezones to IANA timezones.
normalize()  : null|string
Normalize both IANA and Windows timezones into IANA.
parse()  : DateTimeZone
Convert this name into a timezone.
toWindows()  : null|string
Convert a timezone object into a Windows timezone.

Properties

$map

protected static array<string|int, mixed>|null $map = null

Methods

fromIana()

Translate from IANA to Windows timezones.

public static fromIana(string $name) : null|string
Parameters
$name : string

IANA timezone

Return values
null|string —

a windows-style timezone

fromWindows()

Translate between Windows and IANA timezones.

public static fromWindows(string $name) : null|string
Parameters
$name : string

a windows-style timezone

Return values
null|string —

IANA timezone

getIanaMap()

Get a map of IANA timezones to Windows timezones.

public static getIanaMap() : array<string, string>
Return values
array<string, string>

getMap()

Get a map of Windows timezones to IANA timezones.

public static getMap() : array<string, string>
Return values
array<string, string>

normalize()

Normalize both IANA and Windows timezones into IANA.

public static normalize(string $name) : null|string
Parameters
$name : string

IANA or windows timezone

Return values
null|string —

IANA timezone

parse()

Convert this name into a timezone.

public static parse(string $name) : DateTimeZone

This accepts both IANA and Windows timezones. Offsets using 'GMT-XXXX' or 'GMT+XXXX' are naturally accepted by PHP.

Parameters
$name : string
Tags
throws
Exception
Return values
DateTimeZone

toWindows()

Convert a timezone object into a Windows timezone.

public static toWindows(DateTimeZone $zone) : null|string
Parameters
$zone : DateTimeZone
Return values
null|string
On this page

Search results