Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Someone who knows about PHP



11:12 pm on Dec 11, 2008 (gmt 0)

5+ Year Member

Hello using the PHP date function "z" says it goes from 0-365 found here [php.net...]

But 0 shows is a non working field why do they list it that way? I can only get something to actually show
for today dec 11 2008 <snip> if I include something on number 345.

When according to the php manual should only show at 344 instead since first one is supposed to start at 0 not 1.

Can someone please explain this to me? Am trying to explain it to someone else on how php manual yearly date z works and can't, since it isn't making any sense.

Please let me know why the php manual says it should start at 0 when items are only showing starting at 1 instead. Thank you very much for your help.

[edited by: dreamcatcher at 1:33 am (utc) on Dec. 12, 2008]
[edit reason] No personal urls, thanks. [/edit]


11:26 pm on Dec 11, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Probably a fail safe for a leap year.


11:34 pm on Dec 11, 2008 (gmt 0)

5+ Year Member

Thank you any other ideas? Don't think so because this is leap lear which means it should show on 344 instead of 345 since starts at 0. Seems like it would say it starts at 1 instead because what about all the other years that aren't leap year. That's how they do it on all their others they list what they really all start at and if some change they usually don't change at the beginning for a special circumstance like leap year or something else, but at the end instead. Anyone know? Thank you very much for your help.

[edited by: 101Jen at 11:40 pm (utc) on Dec. 11, 2008]


4:38 am on Dec 12, 2008 (gmt 0)

10+ Year Member

the first day of the year is 0 because the date function starts counting at zero, December 11th is 345 because it is the 346th day of the year. New year's eve, December 31st, is 365 because it is the 366th day of the year.

Featured Threads

Hot Threads This Week

Hot Threads This Month