Permalink
Browse files

Merge remote-tracking branch 'fridgesm/bug274'

  • Loading branch information...
2 parents 71ead58 + 55ae6ef commit 4256d225deba32e243f2ab0bab3aac293db577eb @lornajane lornajane committed Mar 19, 2013
Showing with 3 additions and 24 deletions.
  1. +2 −17 src/api-v2/inc/Timezone.php
  2. +1 −7 src/system/application/controllers/talk.php
@@ -47,16 +47,7 @@ public static function getDatetimeFromUnixtime($unixtime, $timezone)
}
$datetime->setTimezone($tz);
- // How much wrong will ->format("U") be if I do it now, due to DST changes?
- // Only needed until PHP Bug #51051 delivers a better method
- $unix_offset1 = $tz->getOffset($datetime);
- $unix_offset2 = $tz->getOffset(new DateTime());
- $unix_correction = $unix_offset1 - $unix_offset2;
-
- // create datetime object corrected for DST offset
- $timestamp = $unixtime + $unix_correction;
-
- $datetime = new DateTime("@{$timestamp}");
+ $datetime = new DateTime("@{$unixtime}");
$datetime->setTimezone($tz);
return $datetime;
}
@@ -127,13 +118,7 @@ public static function UnixtimeForTimeInTimezone(
$dateObj->setDate($year, $month, $day);
$dateObj->setTime($hour, $minute, $second);
- // How much wrong will ->format("U") be if I do it now, due to DST changes?
- // Only needed until PHP Bug #51051 delivers a better method
- $unix_offset1 = $tz->getOffset($dateObj);
- $unix_offset2 = $tz->getOffset(new DateTime());
- $unix_correction = $unix_offset1 - $unix_offset2;
-
- $unixTimestamp = $dateObj->format("U") - $unix_correction;
+ $unixTimestamp = $dateObj->format("U");
return $unixTimestamp;
}
@@ -274,13 +274,7 @@ function add($id = null, $opt = null)
$this->input->post('given_min'), $talk_timezone
);
- // how much wrong will ->format("U") be if I do it now,
- // due to DST changes?
- // only needed until PHP Bug #51051 delivers a better method
- $unix_offset1 = $talk_timezone->getOffset($talk_datetime);
- $unix_offset2 = $talk_timezone->getOffset(new DateTime());
- $unix_correction = $unix_offset1 - $unix_offset2;
- $unix_timestamp = $talk_datetime->format("U") - $unix_correction;
+ $unix_timestamp = $talk_datetime->format("U");
$arr = array(
'talk_title' => $this->input->post('talk_title'),

0 comments on commit 4256d22

Please sign in to comment.