ID:               25787
 Updated by:       [EMAIL PROTECTED]
 Reported By:      australia at bookrealm dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: SuSE Linux 8.2
 PHP Version:      4.3.1
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.




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

[2003-10-08 20:42:09] australia at bookrealm dot com

It is interesting though, that 'tm_mon' shows "0-11", but 
date() and getdate() use "1-12".

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

[2003-10-08 20:31:20] australia at bookrealm dot com

Ok, I'll work with it the way it is. 
 
However, there are two things, maybe in other places too, 
which need to be changed. The values in "Example returned 
values" for both date("z") and 'yday' in getdate() show 
"0-366", these should be changed to "0-365" (as is shown in 
the 'man 3 localtime' you gave me to look at). Else there 
be 366 days in a normal year, and 367 in a leap year? 
 
I still believe it should be "1-366", but ah well. 
 
Cheers, 
Andrew Skripshak

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

[2003-10-08 06:43:35] [EMAIL PROTECTED]

I meant localtime, not date:

# man 3 localtime

And look at the tm_yday section.



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

[2003-10-08 06:37:47] [EMAIL PROTECTED]

There is no bug and this is how it works in libc provided date() too.


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

[2003-10-08 06:27:10] australia at bookrealm dot com

Yes, I figured the count started from zero, but really it 
shouldn't. The 1st of the 1st of any year should be day # 
1, not day # 0. 
 
The manuals state that 'yday' in getdate() and 'z' in 
date() give "The day of the year". This is not correct if 
both are out by one day, and no indication that that is the 
case, and no indication that you must add one day to make 
them correct. 
 
The proper fix would be to fix the code, but a slacker fix 
would be to state in the manuals that you must add a day, 
ie., date("z") + 1, to get the correct "day of the year" 
number. 
 
Up to you, of course, which you choose to do. 
 
Cheers, 
Andrew Skripshak

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/25787

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

Reply via email to