ID:               49079
 Updated by:       [email protected]
 Reported By:      hennessy at thoughtcrime dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Date/time related
 Operating System: Solaris 10
 PHP Version:      5.2.10
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


Previous Comments:
------------------------------------------------------------------------

[2009-07-27 21:59:10] hennessy at thoughtcrime dot com

Description:
------------
When referencing a 4-digit year on a Solaris 10 host with php 5.2.10,
one of my developers was getting '0000' .

Bug 48276 relates to this but was submitted for php5.3 .

I put a patch in the 'Reproduce code' section that 'fixes' it..  

Reproduce code:
---------------
--- php-5.2.10/ext/date/php_date.c      2009-07-27 17:55:06.192343000
-0400
+++ php-5.2.10.1/ext/date/php_date.c    2009-07-27 16:44:23.297327000
-0400
@@ -798,7 +798,8 @@
                        /* 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,
"%s%04ld", t->y < 0 ? "-" : "", llabs(t->y)); break;
+                       /* case 'Y': length = slprintf(buffer, 32,
"%s%04ld", t->y < 0 ? "-" : "", llabs(t->y)); break; */
+                       case 'Y': length = slprintf(buffer, 32, "%d",
(int) t->y); break;
 
                        /* time */
                        case 'a': length = slprintf(buffer, 32, "%s",
t->h >= 12 ? "pm" : "am"); break;




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49079&edit=1

Reply via email to