From 485027f3f14fd112c6ab5339b866e97f4c22fa84 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Mon, 13 Nov 2006 08:19:23 +0000 Subject: [PATCH] patch from Christian this patch fixes the handling of daylight saving --- phpgwapi/inc/horde/Horde/iCalendar.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/iCalendar.php b/phpgwapi/inc/horde/Horde/iCalendar.php index a903d0dded..925a110895 100644 --- a/phpgwapi/inc/horde/Horde/iCalendar.php +++ b/phpgwapi/inc/horde/Horde/iCalendar.php @@ -915,8 +915,8 @@ class Horde_iCalendar { { $temp = array(); if (!is_object($value) || is_array($value)) { - $TZOffset = 3600 * substr(date('O'), 0, 3); - $TZOffset += 60 * substr(date('O'), 3, 2); + $TZOffset = 3600 * substr(date('O',$value), 0, 3); + $TZOffset += 60 * substr(date('O',$value), 3, 2); $value -= $TZOffset; $temp['zone'] = 'UTC'; @@ -929,13 +929,15 @@ class Horde_iCalendar { } else { $dateOb = (object)$value; + $TZOffset = date('O',mktime($dateOb->hour,$dateOb->min,$dateOb->sec,$dateOb->month,$dateOb->mday,$dateOb->year)); + // Minutes. - $TZOffset = substr(date('O'), 3, 2); - $thisMin = $dateOb->min - $TZOffset; + $TZOffsetMin = substr($TZOffset, 0, 1) . substr($TZOffset, 3, 2); + $thisMin = $dateOb->min - $TZOffsetMin; // Hours. - $TZOffset = substr(date('O'), 0, 3); - $thisHour = $dateOb->hour - $TZOffset; + $TZOffsetHour = substr($TZOffset, 0, 3); + $thisHour = $dateOb->hour - $TZOffsetHour; if ($thisMin < 0) { $thisHour -= 1;