homepage Welcome to WebmasterWorld Guest from 54.198.130.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Someone who knows about PHP
101Jen




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

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]

 

StoutFiles




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

Probably a fail safe for a leap year.

101Jen




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

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]

jezra




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved