RE: Fiscal Years and Quarters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don

If you are looking for current quarter you can do this.

$tm = date('Y-m-d H:i:s');
$Current_Fiscal_Quarter = ceil(date("m", $tm)/3);
This will return the quarter you are currently in.
Exmaple 1, 2, 3,or 4 

I have a great quarterly dates function posted on php.net
http://www.php.net/manual/en/function.date.php#100390











-----Original Message-----
From: Don Wieland [mailto:donw@xxxxxxxxxxxxx] 
Sent: Tuesday, October 19, 2010 7:12 PM
To: php-general@xxxxxxxxxxxxx
Subject:  Fiscal Years and Quarters

Hello,

I have a preference field called "Fiscal_Year_Start_Month" which has  
the Month Names as options.

Based on this value, I need to calculate the following date in UNIX:

Current_1st_Quarter_Start_Date
Current_1st_Quarter_End_Date
Current_2nd_Quarter_Start_Date
Current_2nd_Quarter_End_Date
Current_3rd_Quarter_Start_Date
Current_3rd_Quarter_End_Date
Current_4th_Quarter_Start_Date
Current_4th_Quarter_End_Date

Last_1st_Quarter_Start_Date
Last_1st_Quarter_End_Date
Last_2nd_Quarter_Start_Date
Last_2nd_Quarter_End_Date
Last_3rd_Quarter_Start_Date
Last_3rd_Quarter_End_Date
Last_4th_Quarter_Start_Date
Last_4th_Quarter_End_Date

Next_1st_Quarter_Start_Date
Next_1st_Quarter_End_Date
Next_2nd_Quarter_Start_Date
Next_2nd_Quarter_End_Date
Next_3rd_Quarter_Start_Date
Next_3rd_Quarter_End_Date
Next_4th_Quarter_Start_Date
Next_4th_Quarter_End_Date

Then based on TODAY'S date

Current_Fiscal_Quarter - result will be 1, 2, 3,or 4



Don

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux