note 46231 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 12 Jun 2005 11:44:08 +0000 |
| Subject: | note 46231 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90294@lists.php.net to get a copy of this message | ||
Note Submitter: richard at d2p dot us
----
Correction to my post on 27-Sep-2004 01:11
The posting actually finds the number of the current quarter. To find the first month of that
quarter multiply the quarter number by 3, then subtract 2.
<?php
// get the number of the current quarter
$intQuarter = (floor((date('m') - 1) / 3) + 1);
// get the first month of that quarter
$intQuarterFirstMonth = (($intQuarter * 3) - 2);
echo "first month of this quarter is: " . $intQuarterFirstMonth;
?>