<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/2378/bug">
    <title>PEAR Bug #2378</title>
    <link>http://pear.php.net/bugs/2378</link>
    <description>[Closed] getDate(DATE_FORMAT_UNIXTIME) doesn't convert to GMT</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2008-03-23+19%3A04%3A28#2008-03-23+19%3A04%3A28"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2007-11-07+16%3A19%3A48#2007-11-07+16%3A19%3A48"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2006-12-09+03%3A09%3A55#2006-12-09+03%3A09%3A55"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2006-10-01+15%3A41%3A59#2006-10-01+15%3A41%3A59"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-16+05%3A28%3A41#2005-03-16+05%3A28%3A41"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-15+17%3A04%3A45#2005-03-15+17%3A04%3A45"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-15+14%3A48%3A50#2005-03-15+14%3A48%3A50"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-14+16%3A37%3A38#2005-03-14+16%3A37%3A38"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-14+15%3A20%3A33#2005-03-14+15%3A20%3A33"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2005-03-14+14%3A27%3A16#2005-03-14+14%3A27%3A16"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2004-09-25+03%3A11%3A56#2004-09-25+03%3A11%3A56"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/2378/2004-09-24+05%3A54%3A41#2004-09-24+05%3A54%3A41"/>
     </rdf:Seq>
    </items>
  </channel>
    <item rdf:about="http://pear.php.net/bugs/2378">
      <title>scragz@... [2004-09-23 06:32:24]</title>
      <link>http://pear.php.net/bugs/2378</link>
      <description><![CDATA[<pre>Date Bug
Reported by scragz@...
2004-09-23T10:32:24-00:00
PHP: 4.3.8 OS: Debian Sarge Package Version: 

Description:
------------
If you have a Date in another TZ and ask use getDate(DATE_FORMAT_UNIXTIME) or getTime() the timestamp returned will be wrong since it is only using mktime.

Trying to fix this caused me some problems, but I have a patch (below) that seems to work.

Reproduce code:
---------------
&lt;?php
$date =&amp; new Date();
echo $date-&gt;getTime().&quot;\n&quot;;
$date-&gt;convertTZbyID('America/Los_Angeles');
echo $date-&gt;getTime().&quot;\n&quot;;
?&gt;

This patch corrects the faulty behavior. I'm not sure if DATE_FORMAT_TIMESTAMP is expected to be GMT, but this could be adapted to that as well.

Index: Date.php
===================================================================
--- Date.php    (revision 111)
+++ Date.php    (working copy)
@@ -231,7 +231,16 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            if ($date-&gt;tz-&gt;offset) {
+                $offset = ($date-&gt;tz-&gt;offset + $date-&gt;tz-&gt;getDSTSavings()) / 1000;
+                if ($offset &gt; 0) {
+                    $date-&gt;subtractSeconds(intval($offset));
+                } else {
+                    $date-&gt;addSeconds(intval(abs($offset)));
+                }
+            }
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }

Expected result:
----------------
1095935549
1095935549

Actual result:
--------------
1095935549
1095910349</pre>]]></description>
      <content:encoded><![CDATA[<pre>Date Bug
Reported by scragz@...
2004-09-23T10:32:24-00:00
PHP: 4.3.8 OS: Debian Sarge Package Version: 

Description:
------------
If you have a Date in another TZ and ask use getDate(DATE_FORMAT_UNIXTIME) or getTime() the timestamp returned will be wrong since it is only using mktime.

Trying to fix this caused me some problems, but I have a patch (below) that seems to work.

Reproduce code:
---------------
&lt;?php
$date =&amp; new Date();
echo $date-&gt;getTime().&quot;\n&quot;;
$date-&gt;convertTZbyID('America/Los_Angeles');
echo $date-&gt;getTime().&quot;\n&quot;;
?&gt;

This patch corrects the faulty behavior. I'm not sure if DATE_FORMAT_TIMESTAMP is expected to be GMT, but this could be adapted to that as well.

Index: Date.php
===================================================================
--- Date.php    (revision 111)
+++ Date.php    (working copy)
@@ -231,7 +231,16 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            if ($date-&gt;tz-&gt;offset) {
+                $offset = ($date-&gt;tz-&gt;offset + $date-&gt;tz-&gt;getDSTSavings()) / 1000;
+                if ($offset &gt; 0) {
+                    $date-&gt;subtractSeconds(intval($offset));
+                } else {
+                    $date-&gt;addSeconds(intval(abs($offset)));
+                }
+            }
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }

Expected result:
----------------
1095935549
1095935549

Actual result:
--------------
1095935549
1095910349</pre>]]></content:encoded>
      <dc:date>2004-09-23T10:32:24-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2008-03-23+19%3A04%3A28#2008-03-23+19%3A04%3A28">
      <title>c01234 [2008-03-24 00:04]</title>
      <link>http://pear.php.net/bugs/2378#1206317068</link>
      <description><![CDATA[<pre>Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/Date</pre>]]></description>
      <content:encoded><![CDATA[<pre>Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/Date</pre>]]></content:encoded>
      <dc:date>2008-03-24T00:04:28-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2007-11-07+16%3A19%3A48#2007-11-07+16%3A19%3A48">
      <title>c01234 [2007-11-07 21:19]</title>
      <link>http://pear.php.net/bugs/2378#1194470388</link>
      <description><![CDATA[<pre>I think this bug is fixed now in CVS</pre>]]></description>
      <content:encoded><![CDATA[<pre>I think this bug is fixed now in CVS</pre>]]></content:encoded>
      <dc:date>2007-11-07T21:19:48-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2006-12-09+03%3A09%3A55#2006-12-09+03%3A09%3A55">
      <title>firman [2006-12-09 08:09]</title>
      <link>http://pear.php.net/bugs/2378#1165651795</link>
      <description><![CDATA[<pre>Yes, sometimes a value will not change after you call the convertTZbyID(), but your timezone has changed and you will get a right result. It would be wrong result if your patch applied and did BC break.

You can try to run a test script below (with Date-1.4.7 or CVS):
http://cvs.php.net/viewvc.cgi/pear/Date/tests/bugs/bug-2378.phpt?view=markup</pre>]]></description>
      <content:encoded><![CDATA[<pre>Yes, sometimes a value will not change after you call the convertTZbyID(), but your timezone has changed and you will get a right result. It would be wrong result if your patch applied and did BC break.

You can try to run a test script below (with Date-1.4.7 or CVS):
http://cvs.php.net/viewvc.cgi/pear/Date/tests/bugs/bug-2378.phpt?view=markup</pre>]]></content:encoded>
      <dc:date>2006-12-09T08:09:55-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2006-10-01+15%3A41%3A59#2006-10-01+15%3A41%3A59">
      <title>arnaud [2006-10-01 19:41]</title>
      <link>http://pear.php.net/bugs/2378#1159731719</link>
      <description><![CDATA[<pre>Until the package gets a new maintainer.</pre>]]></description>
      <content:encoded><![CDATA[<pre>Until the package gets a new maintainer.</pre>]]></content:encoded>
      <dc:date>2006-10-01T19:41:59-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-16+05%3A28%3A41#2005-03-16+05%3A28%3A41">
      <title>arnaud [2005-03-16 10:28]</title>
      <link>http://pear.php.net/bugs/2378#1110968921</link>
      <description><![CDATA[<pre>Another way is to call gmmktime() if the TZ is UTC. One just needs to convert to the date toUTC() before calling getTime(), no DST detection is needed since it has been taken care of before.</pre>]]></description>
      <content:encoded><![CDATA[<pre>Another way is to call gmmktime() if the TZ is UTC. One just needs to convert to the date toUTC() before calling getTime(), no DST detection is needed since it has been taken care of before.</pre>]]></content:encoded>
      <dc:date>2005-03-16T10:28:41-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-15+17%3A04%3A45#2005-03-15+17%3A04%3A45">
      <title>scragz@... [2005-03-15 22:04]</title>
      <link>http://pear.php.net/bugs/2378#1110924285</link>
      <description><![CDATA[<pre>That's the thing, in my app the TZ gets set so I haven't noticed any problems the way I have it.</pre>]]></description>
      <content:encoded><![CDATA[<pre>That's the thing, in my app the TZ gets set so I haven't noticed any problems the way I have it.</pre>]]></content:encoded>
      <dc:date>2005-03-15T22:04:45-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-15+14%3A48%3A50#2005-03-15+14%3A48%3A50">
      <title>mjs15451@... [2005-03-15 19:48]</title>
      <link>http://pear.php.net/bugs/2378#1110916130</link>
      <description><![CDATA[<pre>Better yet, I did more testing and I found it's better to leave the putenv functions in.  Just make sure you set putenv(TZ=YourTimeZone) before calling any Pear Date functions because PHP doesn't seem to set the server default Timezone in this variable.  A null TZ variable is what is the most problematic.  Obviously this variable setting needs to be allowed in safe mode for any date calculation to actually work correctly.</pre>]]></description>
      <content:encoded><![CDATA[<pre>Better yet, I did more testing and I found it's better to leave the putenv functions in.  Just make sure you set putenv(TZ=YourTimeZone) before calling any Pear Date functions because PHP doesn't seem to set the server default Timezone in this variable.  A null TZ variable is what is the most problematic.  Obviously this variable setting needs to be allowed in safe mode for any date calculation to actually work correctly.</pre>]]></content:encoded>
      <dc:date>2005-03-15T19:48:50-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-14+16%3A37%3A38#2005-03-14+16%3A37%3A38">
      <title>mjs15451@... [2005-03-14 21:37]</title>
      <link>http://pear.php.net/bugs/2378#1110836258</link>
      <description><![CDATA[<pre>I found that the best thing to do is to remove these two lines in timezone.php as they make absolutely no sense to use since all they do is screw up the conversion and it seems to perform just fine without it:

putenv(&quot;TZ=&quot;.$this-&gt;id);
putenv(&quot;TZ=&quot;.$env_tz);</pre>]]></description>
      <content:encoded><![CDATA[<pre>I found that the best thing to do is to remove these two lines in timezone.php as they make absolutely no sense to use since all they do is screw up the conversion and it seems to perform just fine without it:

putenv(&quot;TZ=&quot;.$this-&gt;id);
putenv(&quot;TZ=&quot;.$env_tz);</pre>]]></content:encoded>
      <dc:date>2005-03-14T21:37:38-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-14+15%3A20%3A33#2005-03-14+15%3A20%3A33">
      <title>scragz@... [2005-03-14 20:20]</title>
      <link>http://pear.php.net/bugs/2378#1110831633</link>
      <description><![CDATA[<pre>Below are all of my changes to Date. They involve this bug, bug 2217 (compare), 2401 (more lenient regexp), and maybe something else I'm missing.

--- Date.dist.php       2005-03-14 12:07:42.172448280 -0800
+++ Date.php    2005-02-13 14:08:33.000000000 -0800
@@ -153,7 +153,7 @@
     {

         if (
-            preg_match('/^(\d{4})-?(\d{2})-?(\d{2})([T\s]?(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?(Z|[\+\-]\d{2}:?\d{2})?)?$/i', $date, $regs)
+            preg_match('/^(\d{4})-?(\d{2})-?(\d{2})([T\s]?(\d{2}):?(\d{2}):?(\d{2})?(\.\d+)?(Z|[\+\-]\d{2}:?\d{2})?)?$/i', $date, $regs)
             &amp;&amp; $format != DATE_FORMAT_UNIXTIME) {
             // DATE_FORMAT_ISO, ISO_BASIC, ISO_EXTENDED, and TIMESTAMP
             // These formats are extremely close to each other.  This regex
@@ -231,7 +231,9 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            $date-&gt;toUTC();
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }
@@ -731,6 +733,8 @@
      */
     function compare($d1, $d2)
     {
+        $d1 =&amp; new Date($d1);
+        $d2 =&amp; new Date($d2);
         $d1-&gt;convertTZ(new Date_TimeZone('UTC'));
         $d2-&gt;convertTZ(new Date_TimeZone('UTC'));
         $days1 = Date_Calc::dateToDays($d1-&gt;day, $d1-&gt;month, $d1-&gt;year);
@@ -1222,4 +1226,3 @@
 //
 // END
 ?&gt;
-

--- Date/TimeZone.dist.php      2005-03-14 12:11:59.604192760 -0800
+++ Date/TimeZone.php   2005-02-13 14:08:33.000000000 -0800
@@ -255,7 +255,9 @@
             $env_tz = getenv(&quot;TZ&quot;);
         }
         putenv(&quot;TZ=&quot;.$this-&gt;id);
-        $ltime = localtime($date-&gt;getTime(), true);
+        //$ltime = localtime($date-&gt;getTime(), true);
+        $time = strtotime($date-&gt;getYear().'-'.$date-&gt;getMonth().'-'.$date-&gt;getDay().' '.$date-&gt;getHour().':'.$date-&gt;getMinute().':'.$date-&gt;getSecond());
+        $ltime = localtime($time, true);
         putenv(&quot;TZ=&quot;.$env_tz);
         return $ltime['tm_isdst'];
     }
@@ -3643,4 +3645,3 @@
 //
 // END
 ?&gt;
-</pre>]]></description>
      <content:encoded><![CDATA[<pre>Below are all of my changes to Date. They involve this bug, bug 2217 (compare), 2401 (more lenient regexp), and maybe something else I'm missing.

--- Date.dist.php       2005-03-14 12:07:42.172448280 -0800
+++ Date.php    2005-02-13 14:08:33.000000000 -0800
@@ -153,7 +153,7 @@
     {

         if (
-            preg_match('/^(\d{4})-?(\d{2})-?(\d{2})([T\s]?(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?(Z|[\+\-]\d{2}:?\d{2})?)?$/i', $date, $regs)
+            preg_match('/^(\d{4})-?(\d{2})-?(\d{2})([T\s]?(\d{2}):?(\d{2}):?(\d{2})?(\.\d+)?(Z|[\+\-]\d{2}:?\d{2})?)?$/i', $date, $regs)
             &amp;&amp; $format != DATE_FORMAT_UNIXTIME) {
             // DATE_FORMAT_ISO, ISO_BASIC, ISO_EXTENDED, and TIMESTAMP
             // These formats are extremely close to each other.  This regex
@@ -231,7 +231,9 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            $date-&gt;toUTC();
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }
@@ -731,6 +733,8 @@
      */
     function compare($d1, $d2)
     {
+        $d1 =&amp; new Date($d1);
+        $d2 =&amp; new Date($d2);
         $d1-&gt;convertTZ(new Date_TimeZone('UTC'));
         $d2-&gt;convertTZ(new Date_TimeZone('UTC'));
         $days1 = Date_Calc::dateToDays($d1-&gt;day, $d1-&gt;month, $d1-&gt;year);
@@ -1222,4 +1226,3 @@
 //
 // END
 ?&gt;
-

--- Date/TimeZone.dist.php      2005-03-14 12:11:59.604192760 -0800
+++ Date/TimeZone.php   2005-02-13 14:08:33.000000000 -0800
@@ -255,7 +255,9 @@
             $env_tz = getenv(&quot;TZ&quot;);
         }
         putenv(&quot;TZ=&quot;.$this-&gt;id);
-        $ltime = localtime($date-&gt;getTime(), true);
+        //$ltime = localtime($date-&gt;getTime(), true);
+        $time = strtotime($date-&gt;getYear().'-'.$date-&gt;getMonth().'-'.$date-&gt;getDay().' '.$date-&gt;getHour().':'.$date-&gt;getMinute().':'.$date-&gt;getSecond());
+        $ltime = localtime($time, true);
         putenv(&quot;TZ=&quot;.$env_tz);
         return $ltime['tm_isdst'];
     }
@@ -3643,4 +3645,3 @@
 //
 // END
 ?&gt;
-</pre>]]></content:encoded>
      <dc:date>2005-03-14T20:20:33-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2005-03-14+14%3A27%3A16#2005-03-14+14%3A27%3A16">
      <title>mjs15451@... [2005-03-14 19:27]</title>
      <link>http://pear.php.net/bugs/2378#1110828436</link>
      <description><![CDATA[<pre>So what is the final patch for this since no one seems to be maintaining this?</pre>]]></description>
      <content:encoded><![CDATA[<pre>So what is the final patch for this since no one seems to be maintaining this?</pre>]]></content:encoded>
      <dc:date>2005-03-14T19:27:16-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2004-09-25+03%3A11%3A56#2004-09-25+03%3A11%3A56">
      <title>scragz@... [2004-09-25 07:11]</title>
      <link>http://pear.php.net/bugs/2378#1096096316</link>
      <description><![CDATA[<pre>That whole patch could be consolidated to a single call to $date-&gt;toUTC(). Also, I just realized that Date_TimeZone::inDaylightTime() uses Date::getTime(), which causes recursion that segfaults PHP. I kluged through this by using strtotime(), which seems to be working since the TZ env variable is set right before there.</pre>]]></description>
      <content:encoded><![CDATA[<pre>That whole patch could be consolidated to a single call to $date-&gt;toUTC(). Also, I just realized that Date_TimeZone::inDaylightTime() uses Date::getTime(), which causes recursion that segfaults PHP. I kluged through this by using strtotime(), which seems to be working since the TZ env variable is set right before there.</pre>]]></content:encoded>
      <dc:date>2004-09-25T07:11:56-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/2378/2004-09-24+05%3A54%3A41#2004-09-24+05%3A54%3A41">
      <title>scragz@... [2004-09-24 09:54]</title>
      <link>http://pear.php.net/bugs/2378#1096019681</link>
      <description><![CDATA[<pre>Forgot DST.

--- Date.php    (revision 100)
+++ Date.php    (working copy)
@@ -231,7 +231,17 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            if ($date-&gt;tz-&gt;offset) {
+                $dst = ($date-&gt;inDaylightTime()) ? $date-&gt;tz-&gt;getDSTSavings() : 0;
+                $offset = ($date-&gt;tz-&gt;offset + $dst) / 1000;
+                if ($offset &gt; 0) {
+                    $date-&gt;subtractSeconds(intval($offset));
+                } else {
+                    $date-&gt;addSeconds(intval(abs($offset)));
+                }
+            }
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }</pre>]]></description>
      <content:encoded><![CDATA[<pre>Forgot DST.

--- Date.php    (revision 100)
+++ Date.php    (working copy)
@@ -231,7 +231,17 @@
             return $this-&gt;format(&quot;%Y%m%d%H%M%S&quot;);
             break;
         case DATE_FORMAT_UNIXTIME:
-            return mktime($this-&gt;hour, $this-&gt;minute, $this-&gt;second, $this-&gt;month, $this-&gt;day, $this-&gt;year);
+            $date =&amp; new Date($this);
+            if ($date-&gt;tz-&gt;offset) {
+                $dst = ($date-&gt;inDaylightTime()) ? $date-&gt;tz-&gt;getDSTSavings() : 0;
+                $offset = ($date-&gt;tz-&gt;offset + $dst) / 1000;
+                if ($offset &gt; 0) {
+                    $date-&gt;subtractSeconds(intval($offset));
+                } else {
+                    $date-&gt;addSeconds(intval(abs($offset)));
+                }
+            }
+            return mktime($date-&gt;hour, $date-&gt;minute, $date-&gt;second, $date-&gt;month, $date-&gt;day, $date-&gt;year);
             break;
         }
     }</pre>]]></content:encoded>
      <dc:date>2004-09-24T09:54:41-00:00</dc:date>
    </item>
</rdf:RDF>