Re: Date Calculation Help

From: Date: Tue, 03 Jul 2007 05:43:19 +0000
Subject: Re: Date Calculation Help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258073@lists.php.net to get a copy of this message
If the date is coming from a database, there might be a function/format already for that... And http://php.net/date may also have a format specifier for Quarter. If not, try this: $quarter = ((int) ($month / 4)) + 1; On Sat, June 30, 2007 10:14 am, revDAVE wrote: > I have segmented a year into four quarters (3 months each) > > nowdate = the month of the chosen date (ex: 5-30-07 = month 5) > > Q: What is the best way to calculate which quarter (1-2-3 or 4) the > chosen > date falls on? > > Result - Ex: 5-30-07 = month 5 and should fall in quarter 2 > > > > -- > Thanks - RevDave > CoolCat@hosting4days.com > [db-lists] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#258073) next »