derick          Thu Jul 12 18:59:05 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/date   php_date.c 
  Log:
  - MFH: Missing file in previous commit.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.50&r2=1.43.2.45.2.51&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.50 
php-src/ext/date/php_date.c:1.43.2.45.2.51
--- php-src/ext/date/php_date.c:1.43.2.45.2.50  Thu Jun  7 23:16:04 2007
+++ php-src/ext/date/php_date.c Thu Jul 12 18:59:05 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.50 2007/06/07 23:16:04 iliaa Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.51 2007/07/12 18:59:05 derick Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -775,7 +775,7 @@
                        /* year */
                        case 'L': length = slprintf(buffer, 32, "%d", 
timelib_is_leap((int) t->y)); break;
                        case 'y': length = slprintf(buffer, 32, "%02d", (int) 
t->y % 100); break;
-                       case 'Y': length = slprintf(buffer, 32, "%04d", (int) 
t->y); break;
+                       case 'Y': length = slprintf(buffer, 32, "%s%04d", t->y 
< 0 ? "-" : "", abs((int) t->y)); break;
 
                        /* time */
                        case 'a': length = slprintf(buffer, 32, "%s", t->h >= 
12 ? "pm" : "am"); break;
@@ -1740,7 +1740,7 @@
        parsed_time = timelib_strtotime(date, date_len, &error, 
DATE_TIMEZONEDB);
        array_init(return_value);
 #define PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(name, elem) \
-       if (parsed_time->elem == -1) {               \
+       if (parsed_time->elem == -99999) {               \
                add_assoc_bool(return_value, #name, 0); \
        } else {                                       \
                add_assoc_long(return_value, #name, parsed_time->elem); \
@@ -1752,7 +1752,7 @@
        PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(minute,    i);
        PHP_DATE_PARSE_DATE_SET_TIME_ELEMENT(second,    s);
        
-       if (parsed_time->f == -1) {
+       if (parsed_time->f == -99999) {
                add_assoc_bool(return_value, "fraction", 0);
        } else {
                add_assoc_double(return_value, "fraction", parsed_time->f);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to