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
Well then after or before that you have to check that the month value is
between 1 and 12 to make sure there's no input errors, then what if you ever
want ot change the quarters yeah anway I just wanted an excuse to tell
people to go low tech and use a switch, it's only 12 entries, and you c
of course ceil( month / 3 );
--
/Thunis
Don't panic.
--The Hitchikers Guide to the Galaxy
Fredrik Thunberg skrev:
$q = ceil( month / 4 );
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$q = ceil( month / 4 );
--
/Thunis
The ships hung in the sky in much the same way that bricks don't.
--The Hitchikers Guide to the Galaxy
revDAVE skrev:
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
At 6/30/2007 08: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 f
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
6 matches
Mail list logo