[Jaws-commits] r13236 - branches/0.8/html/include

afz at jaws-project.com afz at jaws-project.com
Fri Aug 3 16:50:50 UTC 2012


Author: afz
Date: 2012-08-03 16:50:50 +0000 (Fri, 03 Aug 2012)
New Revision: 13236

Modified:
   branches/0.8/html/include/Jaws.php
Log:
Added daylight saving time support

Modified: branches/0.8/html/include/Jaws.php
===================================================================
--- branches/0.8/html/include/Jaws.php	2012-08-03 16:04:17 UTC (rev 13235)
+++ branches/0.8/html/include/Jaws.php	2012-08-03 16:50:50 UTC (rev 13236)
@@ -1179,7 +1179,15 @@
                            $time[0]);
         }
         $time = is_numeric($time)? $time : strtotime($time);
-        $time = $time + ($this->_UserTimezone * 3600);
+        // GMT offset
+        if (is_numeric($this->_UserTimezone)) {
+            $gmt_offset = $this->_UserTimezone * 3600;
+        } else {
+            @date_default_timezone_set($this->_UserTimezone);
+            $gmt_offset = date('Z', $time);
+            date_default_timezone_set('UTC');
+        }
+        $time = $time + $gmt_offset;
         return empty($format)? $time : date($format, $time);
     }
 
@@ -1202,7 +1210,15 @@
                            $time[0]);
         }
         $time = is_numeric($time)? $time : strtotime($time);
-        $time = $time - ($this->_UserTimezone * 3600);
+        // GMT offset
+        if (is_numeric($this->_UserTimezone)) {
+            $gmt_offset = $this->_UserTimezone * 3600;
+        } else {
+            @date_default_timezone_set($this->_UserTimezone);
+            $gmt_offset = date('Z', $time);
+            date_default_timezone_set('UTC');
+        }
+        $time = $time - $gmt_offset;
         return empty($format)? $time : date($format, $time);
     }
 



More information about the Jaws-commits mailing list