ID:               30225
 Comment by:       scottm at spamcop dot net
 Reported By:      lywenn at free dot fr
 Status:           Open
 Bug Type:         Date/time related
 Operating System: Slackware Linux 10.0
 PHP Version:      5.0.0
 New Comment:

PHP calculates the day of the year from 0-365 as it says in the PHP
documentation which is what is presented in the tm struct for tm_yday.

GNU date binary lists this from 1-366.

[EMAIL PROTECTED] root]# date +%j -d"1/1/2004"
001

[EMAIL PROTECTED] root]# php -r 'echo date("z", mktime(0,0,0,1,1,2004));'
0

Bogus?


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

[2004-09-25 00:24:27] lywenn at free dot fr

Description:
------------
date("z"); seem to don't add a day in leapyears

today it returns 268 instead of 267 :)

[EMAIL PROTECTED] msk $ date
sam sep 25 00:15:05 CEST 2004
[EMAIL PROTECTED] msk $ date +%j
269

Reproduce code:
---------------
date("z");

Expected result:
----------------
[EMAIL PROTECTED] msk $ date
sam sep 25 00:15:05 CEST 2004
[EMAIL PROTECTED] msk $ date +%j
269


while php date("z") returns : 268

:)



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


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

Reply via email to