$_startDate
$_startDate : \Horde_Date
Date to use as start date when iterating through offsets looking for a transition.
Utility functions for dealing with Microsoft ActiveSync's Timezone format.
Copyright 2009-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Code dealing with searching for a timezone identifier from an AS timezone blob inspired by code in the Tine20 Project (http://tine20.org).
getTimezone(array|string $offsets, string $expectedTimezone = null) : string
Attempt to guess the timezone identifier from the $offsets array.
array|string | $offsets | The timezone to check. Either an array of offsets or an activesynz tz blob. |
string | $expectedTimezone | The expected timezone. If not empty, and present in the results, will return. |
The timezone identifier
getListOfTimezones(array|string $offsets, string $expectedTimezone = null) : array
Get the list of timezone identifiers that match the given offsets, having a preference for $expectedTimezone if it's present in the results.
array|string | $offsets | Either an offset array, or a AS timezone structure. |
string | $expectedTimezone | The expected timezone. |
An array of timezone identifiers
_getTransitions(\DateTimeZone $timezone, \Horde_Date $date) : array
Get the transition data for moving from DST to STD time.
\DateTimeZone | $timezone | The timezone to get the transition for |
\Horde_Date | $date | The date to start from. Really only the year we are interested in is needed. |
An array containing the the STD and DST transitions
_generateOffsetsForTransition(array $offsets, array $transition, string $type) : array
Calculate the offsets for the specified transition
array | $offsets | A TZ offset hash |
array | $transition | A transition hash |
string | $type | Transition type - dst or std |
A populated offset hash
_checkTimezone(\DateTimeZone $timezone, array $offsets) : array|boolean
Check if the given timezone matches the offsets and also evaluate the daylight saving time transitions for this timezone if necessary.
\DateTimeZone | $timezone | The timezone to check. |
array | $offsets | The offsets to check. |
An array of transition data or false if timezone does not match offset.
_checkTransition(array $std, array $dst, array $offsets) : boolean
Check if the given standardTransition and daylightTransition match to the given offsets.
array | $std | The Standard transition date. |
array | $dst | The DST transition date. |
array | $offsets | The offsets to check. |
_isNthOcurrenceOfWeekdayInMonth(integer $timestamp, integer $occurence) : boolean
Test if the weekday of the given timestamp is the nth occurence of this weekday within its month, where '5' indicates the last occurrence even if there is less than five occurrences.
integer | $timestamp | The timestamp to check. |
integer | $occurence | 1 to 5, where 5 indicates the final occurrence during the month if that day of the week does not occur 5 times |