Fiscal Year & Quarters
date->getCurrentFiscalYearQuarter()
Method to calculate the active fiscal trimester quarter number for a NepaliDate instance.
The getCurrentFiscalYearQuarter method returns an integer from 1 to 4 representing the active fiscal trimester of the current date. Because Nepal fiscal calendar starts in Shrawan, quarter 1 covers Shrawan through Ashwin, quarter 2 spans Kartik through Poush, quarter 3 covers Magh through Chaitra, and quarter 4 spans Baisakh through Ashadh.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function getCurrentFiscalYearQuarter(): int;Parameters
- None.
Return Value
- Type:
int - Range:
1to4 - Description: The fiscal trimester index for the date.
Trimester Mapping Table
| Month Index | Month Name | Fiscal Quarter | Trimester Label |
|---|---|---|---|
3 | Shrawan | 1 | First Trimester (Q1) |
4 | Bhadra | 1 | First Trimester (Q1) |
5 | Aswin | 1 | First Trimester (Q1) |
6 | Kartik | 2 | Second Trimester (Q2) |
7 | Mangsir | 2 | Second Trimester (Q2) |
8 | Poush | 2 | Second Trimester (Q2) |
9 | Magh | 3 | Third Trimester (Q3) |
10 | Falgun | 3 | Third Trimester (Q3) |
11 | Chaitra | 3 | Third Trimester (Q3) |
0 | Baisakh | 4 | Fourth Trimester (Q4) |
1 | Jestha | 4 | Fourth Trimester (Q4) |
2 | Asar | 4 | Fourth Trimester (Q4) |
Examples
use NepaliDateLibrary\NepaliDate;
$date1 = new NepaliDate('2081-04-15'); // Shrawan
echo $date1->getCurrentFiscalYearQuarter(); // 1
$date2 = new NepaliDate('2081-07-20'); // Kartik
echo $date2->getCurrentFiscalYearQuarter(); // 2
$date3 = new NepaliDate('2081-10-10'); // Magh
echo $date3->getCurrentFiscalYearQuarter(); // 3
$date4 = new NepaliDate('2082-01-05'); // Baisakh
echo $date4->getCurrentFiscalYearQuarter(); // 4Related
date->getCurrentFiscalYearQuarterDates(): Retrieve boundary start and end dates.date->getCurrentQuarter(): Standard Bikram Sambat calendar quarter.
Advertisement
NepaliDate::getCurrentFiscalYear()
Method to retrieve the formatted fiscal year string for a given NepaliDate instance.
date->getCurrentFiscalYearQuarterDates()
Method to retrieve exact start and end boundary dates for the active fiscal quarter.