mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 05:16:06 +03:00
General: (sim642) Pull Request 489 - Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel
This commit is contained in:
parent
a1dee8f6c3
commit
c4782b6606
@ -182,10 +182,17 @@ class PHPExcel_Shared_Date
|
|||||||
{
|
{
|
||||||
$saveTimeZone = date_default_timezone_get();
|
$saveTimeZone = date_default_timezone_get();
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
|
$timezoneAdjustment = ($adjustToTimezone) ?
|
||||||
|
PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone ? $timezone : $saveTimeZone, $dateValue) :
|
||||||
|
0;
|
||||||
|
|
||||||
$retValue = false;
|
$retValue = false;
|
||||||
if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) {
|
if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) {
|
||||||
|
$dateValue->add(new DateInterval('PT' . $timezoneAdjustment . 'S'));
|
||||||
$retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s'));
|
$retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s'));
|
||||||
} elseif (is_numeric($dateValue)) {
|
} elseif (is_numeric($dateValue)) {
|
||||||
|
$dateValue += $timezoneAdjustment;
|
||||||
$retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue));
|
$retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue));
|
||||||
} elseif (is_string($dateValue)) {
|
} elseif (is_string($dateValue)) {
|
||||||
$retValue = self::stringToExcel($dateValue);
|
$retValue = self::stringToExcel($dateValue);
|
||||||
|
@ -34,6 +34,7 @@ Planned for 1.8.2
|
|||||||
- Feature: (Tomino2112) Work Item GH-808 - MemoryDrawing not working in HTML writer
|
- Feature: (Tomino2112) Work Item GH-808 - MemoryDrawing not working in HTML writer
|
||||||
- General: (rentalhost) Work Item GH-575 - Excel 2007 Reader freezes because of conditional formatting
|
- General: (rentalhost) Work Item GH-575 - Excel 2007 Reader freezes because of conditional formatting
|
||||||
- Bugfix: (vitalyrepin) Pull Request 869 - c:max and c:min elements shall NOT be inside c:orientation elements
|
- Bugfix: (vitalyrepin) Pull Request 869 - c:max and c:min elements shall NOT be inside c:orientation elements
|
||||||
|
- General: (sim642) Pull Request 489 - Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel
|
||||||
|
|
||||||
|
|
||||||
2015-04-30 (v1.8.1):
|
2015-04-30 (v1.8.1):
|
||||||
|
Loading…
Reference in New Issue
Block a user