Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
May 17th, 2000, 02:06 PM
Junior Member

Join Date: Apr 2000
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
How can I calculate the number of days since the beginning of the present year ?
Lets say I have a day May 17th and I want to know which day number it is in the 365 day cycle.
ex: january 10th is day 10
May 17th is day 108

Thanks,
Peter

#2
May 17th, 2000, 03:13 PM
 aarongb
Contributing User

Join Date: Mar 2000
Posts: 60
Time spent in forums: < 1 sec
Reputation Power: 14
Simple.
date("z");

found at: http://www.php.net/manual/function.date.php3

If Rod k finds a simpler solution, I am going to punch myself.

#3
May 17th, 2000, 03:14 PM
 scollo
Contributing User

Join Date: Apr 1999
Posts: 114
Time spent in forums: 42 m 44 sec
Reputation Power: 15
echo (date ("z", time()));

#4
May 17th, 2000, 03:16 PM
 scollo
Contributing User

Join Date: Apr 1999
Posts: 114
Time spent in forums: 42 m 44 sec
Reputation Power: 15
Aaron,

I don't mean this as a simpler solution. We were responding at the same time and didn't realize it.

-- Christopher

#5
May 17th, 2000, 04:30 PM
Junior Member

Join Date: Apr 2000
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
Wow ! was that an easy one, guess I need to by another book on PHP as I was not able to find such an example. Thanks

#6
May 18th, 2000, 09:08 AM
 rod k
Apprentice Deity

Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237
Time spent in forums: 4 m 8 sec
Reputation Power: 18
LOL @ aaron

 Viewing: Dev Shed Forums > Programming Languages > PHP Development > Date calculations