From: john dot oconnor at landingnet dot co dot uk
Operating system: Linux
PHP version: 5.2.6
PHP Bug Type: Date/time related
Bug description: date_create DateTime format('z') returns null
Description:
------------
When using date_create to find out the day of the year for a given date
using the date string format 'z', you expect a result from 0-365.
When testing 2008-01-02 you get the expected result 1.
With 2008-01-01 the format returns null, incorrectly.
Reproduce code:
---------------
$date_time = date_create('2008-01-01 00:00:00');
$formatted_time = $date_time->format('z');
var_dump($formatted_time);
Expected result:
----------------
integer of value zero.
Actual result:
--------------
null
--
Edit bug report at http://bugs.php.net/?id=45725&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45725&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45725&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45725&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45725&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45725&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45725&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45725&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45725&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45725&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45725&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45725&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45725&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45725&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45725&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45725&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45725&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45725&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45725&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45725&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45725&r=mysqlcfg