#45725 [Opn->Csd]: date_create DateTime format('z') returns null

From: Date: Tue, 05 Aug 2008 13:10:10 +0000
Subject: #45725 [Opn->Csd]: date_create DateTime format('z') returns null
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127630@lists.php.net to get a copy of this message
ID: 45725 User updated by: john dot oconnor at landingnet dot co dot uk Reported By: john dot oconnor at landingnet dot co dot uk -Status: Open +Status: Closed Bug Type: Date/time related Operating System: Linux PHP Version: 5.2.6 New Comment: submitted in error Previous Comments: ------------------------------------------------------------------------ [2008-08-05 12:53:44] john dot oconnor at landingnet dot co dot uk 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 this bug report at http://bugs.php.net/?id=45725&edit=1

« previous php.bugs (#127630) next »