how to get the day number of the year, help please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
danwguy
Forum Contributor
Posts: 256
Joined: Wed Nov 17, 2010 1:09 pm
Location: San Diego, CA

how to get the day number of the year, help please

Post by danwguy »

Ok, so here's my question/problem... Given that December 31st is the 365th day of the year and January 1st is the 1st day of the year, is there any way to figure out what say sep 26th is, or for that matter, if I had a date how could I figure out what is the day number of the year? I thought for a second it was going to be as easy as month*30+day but that just won't work properly at all. Anyone have any ideas?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: how to get the day number of the year, help please

Post by Celauran »

Post Reply