derick Mon Apr 7 17:44:04 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/date/lib parse_tz.c unixtime2tm.c
Log:
- MFH: Fixing returned offset.
- MFH: Algorithm optimization.
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_tz.c?r1=1.20.2.6.2.13.2.1&r2=1.20.2.6.2.13.2.2&diff_format=u
Index: php-src/ext/date/lib/parse_tz.c
diff -u php-src/ext/date/lib/parse_tz.c:1.20.2.6.2.13.2.1
php-src/ext/date/lib/parse_tz.c:1.20.2.6.2.13.2.2
--- php-src/ext/date/lib/parse_tz.c:1.20.2.6.2.13.2.1 Mon Dec 31 07:17:07 2007
+++ php-src/ext/date/lib/parse_tz.c Mon Apr 7 17:44:03 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_tz.c,v 1.20.2.6.2.13.2.1 2007/12/31 07:17:07 sebastian Exp $ */
+/* $Id: parse_tz.c,v 1.20.2.6.2.13.2.2 2008/04/07 17:44:03 derick Exp $ */
#include "timelib.h"
@@ -391,7 +391,7 @@
switch (t->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET:
- return t->z * 60;
+ return (t->z + t->dst) * -60;
case TIMELIB_ZONETYPE_ID:
gmt_offset = timelib_get_time_zone_info(t->sse,
t->tz_info);
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/unixtime2tm.c?r1=1.12.2.4.2.3.2.1&r2=1.12.2.4.2.3.2.2&diff_format=u
Index: php-src/ext/date/lib/unixtime2tm.c
diff -u php-src/ext/date/lib/unixtime2tm.c:1.12.2.4.2.3.2.1
php-src/ext/date/lib/unixtime2tm.c:1.12.2.4.2.3.2.2
--- php-src/ext/date/lib/unixtime2tm.c:1.12.2.4.2.3.2.1 Mon Dec 31 07:17:07 2007
+++ php-src/ext/date/lib/unixtime2tm.c Mon Apr 7 17:44:03 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: unixtime2tm.c,v 1.12.2.4.2.3.2.1 2007/12/31 07:17:07 sebastian Exp $ */
+/* $Id: unixtime2tm.c,v 1.12.2.4.2.3.2.2 2008/04/07 17:44:03 derick Exp $ */
#include "timelib.h"
@@ -76,12 +76,18 @@
*/
while (tmp_days <= 0) {
- cur_year--;
- DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days,
cur_year););
- if (timelib_is_leap(cur_year)) {
- tmp_days += DAYS_PER_LYEAR;
+ if (tmp_days < -1460970) {
+ cur_year -= 4000;
+ DEBUG(printf("tmp_days=%lld, year=%lld\n",
tmp_days, cur_year););
+ tmp_days += 1460970;
} else {
- tmp_days += DAYS_PER_YEAR;
+ cur_year--;
+ DEBUG(printf("tmp_days=%lld, year=%lld\n",
tmp_days, cur_year););
+ if (timelib_is_leap(cur_year)) {
+ tmp_days += DAYS_PER_LYEAR;
+ } else {
+ tmp_days += DAYS_PER_YEAR;
+ }
}
}
remainder += SECS_PER_DAY;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php