Re: Can't get accurate day of year
| From: | Jim Winstead | Date: | Sat, 05 Jan 2002 23:24:25 +0000 |
| Subject: | Re: Can't get accurate day of year | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79582@lists.php.net to get a copy of this message | ||
Hugh Danaher <hdanaher@earthlink.net> wrote:
> Hello All and Happy New Year.
> I have a simple routine to get the year, date and the day of year.
> Year and date come out correctly but the day of year is one less than
> the date. It being January, it's easy to see the error. The only
> thing I can figure, is that the date(z) function gets a fractional
> value and rounds down not rounds up. I really could use some input on
> this before I just add one to the result and move on.
as http://www.php.net/date says, the range of the
'z' format is from 0
to 365. january 1st is day 0.
jim