Re: [PHP] Date Calculation Help

2007-07-02 Thread Fredrik Thunberg
$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

Re: [PHP] Date Calculation Help

2007-07-02 Thread Fredrik Thunberg
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

Re: [PHP] Date Calculation Help

2007-07-02 Thread Dan
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

Re: [PHP] Date Calculation Help

2007-07-02 Thread Richard Lynch
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

[PHP] Date Calculation Help

2007-06-30 Thread revDAVE
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

Re: [PHP] Date Calculation Help

2007-06-30 Thread Paul Novitski
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