#49079 [NEW]: date calls for year (Y) returns 0000

From: Date: Mon, 27 Jul 2009 21:59:10 +0000
Subject: #49079 [NEW]: date calls for year (Y) returns 0000
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-140343@lists.php.net to get a copy of this message
From: hennessy at thoughtcrime dot com Operating system: Solaris 10 PHP version: 5.2.10 PHP Bug Type: Date/time related Bug description: date calls for year (Y) returns 0000 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 bug report at http://bugs.php.net/?id=49079&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49079&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49079&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49079&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49079&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49079&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49079&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49079&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49079&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49079&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49079&r=support Expected behavior: http://bugs.php.net/fix.php?id=49079&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49079&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49079&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49079&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49079&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49079&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49079&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49079&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49079&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49079&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49079&r=mysqlcfg

« previous php.bugs (#140343) next »