ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Shared_TimeZone Class Reference
+ Collaboration diagram for PHPExcel_Shared_TimeZone:

Static Public Member Functions

static _validateTimeZone ($timezone)
 Validate a Timezone name. More...
 
static setTimeZone ($timezone)
 Set the Default Timezone used for date/time conversions. More...
 
static getTimeZone ()
 Return the Default Timezone used for date/time conversions. More...
 
static getTimeZoneAdjustment ($timezone, $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. More...
 

Static Protected Attributes

static $_timezone = 'UTC'
 

Static Private Member Functions

static _getTimezoneTransitions ($objTimezone, $timestamp)
 Return the Timezone transition for the specified timezone and timestamp. More...
 

Detailed Description

Definition at line 37 of file TimeZone.php.

Member Function Documentation

◆ _getTimezoneTransitions()

static PHPExcel_Shared_TimeZone::_getTimezoneTransitions (   $objTimezone,
  $timestamp 
)
staticprivate

Return the Timezone transition for the specified timezone and timestamp.

Parameters
DateTimeZone$objTimezoneThe timezone for finding the transitions
integer$timestampPHP date/time value for finding the current transition
Returns
array The current transition details

Definition at line 92 of file TimeZone.php.

92 {
93 $allTransitions = $objTimezone->getTransitions();
94 $transitions = array();
95 foreach($allTransitions as $key => $transition) {
96 if ($transition['ts'] > $timestamp) {
97 $transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition;
98 break;
99 }
100 if (empty($transitions)) {
101 $transitions[] = end($allTransitions);
102 }
103 }
104
105 return $transitions;
106 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
$key
Definition: croninfo.php:18

References $key, and $timestamp.

Referenced by getTimeZoneAdjustment().

+ Here is the caller graph for this function:

◆ _validateTimeZone()

static PHPExcel_Shared_TimeZone::_validateTimeZone (   $timezone)
static

Validate a Timezone name.

Parameters
string$timezoneTime zone (e.g. 'Europe/London')
Returns
boolean Success or failure

Definition at line 53 of file TimeZone.php.

53 {
54 if (in_array($timezone, DateTimeZone::listIdentifiers())) {
55 return TRUE;
56 }
57 return FALSE;
58 }

◆ getTimeZone()

static PHPExcel_Shared_TimeZone::getTimeZone ( )
static

Return the Default Timezone used for date/time conversions.

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

Definition at line 80 of file TimeZone.php.

80 {
81 return self::$_timezone;
82 } // function getTimezone()

References $_timezone.

◆ getTimeZoneAdjustment()

static PHPExcel_Shared_TimeZone::getTimeZoneAdjustment (   $timezone,
  $timestamp 
)
static

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$timezoneThe timezone for finding the adjustment to UST
integer$timestampPHP date/time value
Returns
integer Number of seconds for timezone adjustment
Exceptions
PHPExcel_Exception

Definition at line 117 of file TimeZone.php.

117 {
118 if ($timezone !== NULL) {
119 if (!self::_validateTimezone($timezone)) {
120 throw new PHPExcel_Exception("Invalid timezone " . $timezone);
121 }
122 } else {
123 $timezone = self::$_timezone;
124 }
125
126 if ($timezone == 'UST') {
127 return 0;
128 }
129
130 $objTimezone = new DateTimeZone($timezone);
131 if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
132 $transitions = $objTimezone->getTransitions($timestamp,$timestamp);
133 } else {
134 $transitions = self::_getTimezoneTransitions($objTimezone, $timestamp);
135 }
136
137 return (count($transitions) > 0) ? $transitions[0]['offset'] : 0;
138 }
static _getTimezoneTransitions($objTimezone, $timestamp)
Return the Timezone transition for the specified timezone and timestamp.
Definition: TimeZone.php:92

References $_timezone, $timestamp, and _getTimezoneTransitions().

+ Here is the call graph for this function:

◆ setTimeZone()

static PHPExcel_Shared_TimeZone::setTimeZone (   $timezone)
static

Set the Default Timezone used for date/time conversions.

Parameters
string$timezoneTime zone (e.g. 'Europe/London')
Returns
boolean Success or failure

Definition at line 66 of file TimeZone.php.

66 {
67 if (self::_validateTimezone($timezone)) {
68 self::$_timezone = $timezone;
69 return TRUE;
70 }
71 return FALSE;
72 } // function setTimezone()

Field Documentation

◆ $_timezone

PHPExcel_Shared_TimeZone::$_timezone = 'UTC'
staticprotected

Definition at line 45 of file TimeZone.php.

Referenced by getTimeZone(), and getTimeZoneAdjustment().


The documentation for this class was generated from the following file: