#18779 [Opn->Bgs]: Date("yz") returns wrong julian date
| From: | eru@php.net | Date: | Wed, 07 Aug 2002 13:30:06 +0000 |
| Subject: | #18779 [Opn->Bgs]: Date("yz") returns wrong julian date | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16168@lists.php.net to get a copy of this message | ||
ID: 18779
Updated by: eru@php.net
Reported By: pdaugherty@cem.va.gov
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Redhat Linux 7.3 Kernel 2.4.18-5
PHP Version: 4.2.1
New Comment:
Which is totally correct, because the range of days is from 0 to 365.
From the manual:
z - day of the year; i.e. "0" to "365"
date( "z", mktime( 0, 0, 0, 1, 1, 2002 ) );
Previous Comments:
------------------------------------------------------------------------
[2002-08-07 09:21:37] pdaugherty@cem.va.gov
But the actual day of the year on August 7th 2002 is 219 not 218. The
format is ok, but the date calculation is wrong.
------------------------------------------------------------------------
[2002-08-07 09:12:34] georg@php.net
The result from date("yz") is ok: y=02, and z=218. z is the day of the
year from 0..365 (as described in the documentation).
------------------------------------------------------------------------
[2002-08-07 08:19:32] pdaugherty@cem.va.gov
edit spelling
------------------------------------------------------------------------
[2002-08-07 08:16:33] pdaugherty@cem.va.gov
Date("yz") returns wrong julian date.
For 8/7/02, php funcion 'date("yz")' returns 02218, which is wrong.
Php function 'date("d-M-Y") returns 07-Aug-2002, which is correct. The
shell command "date +%j" returns the proper julian date of 219.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18779&edit=1