You are here

private static function PHPExcel_Shared_TimeZone::_getTimezoneTransitions in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/TimeZone.php \PHPExcel_Shared_TimeZone::_getTimezoneTransitions()

* Return the Timezone transition for the specified timezone and timestamp * *

Parameters

DateTimeZone $objTimezone The timezone for finding the transitions: * @param integer $timestamp PHP date/time value for finding the current transition * @return array The current transition details

1 call to PHPExcel_Shared_TimeZone::_getTimezoneTransitions()
PHPExcel_Shared_TimeZone::getTimeZoneAdjustment in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/TimeZone.php
* 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 * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/TimeZone.php, line 92

Class

PHPExcel_Shared_TimeZone
PHPExcel_Shared_TimeZone

Code

private static function _getTimezoneTransitions($objTimezone, $timestamp) {
  $allTransitions = $objTimezone
    ->getTransitions();
  $transitions = array();
  foreach ($allTransitions as $key => $transition) {
    if ($transition['ts'] > $timestamp) {
      $transitions[] = $key > 0 ? $allTransitions[$key - 1] : $transition;
      break;
    }
    if (empty($transitions)) {
      $transitions[] = end($allTransitions);
    }
  }
  return $transitions;
}