1. Go to this page and download the library: Download gtmassey/quarter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
//Jan 1, 2020 - Mar 31, 2020
Quarter::first()->year(2020);
//Jan 1, 0020 - Mar 31, 0020
Quarter::first()->year(20);
//Jan 1, 1995 - Mar 31, 1995
Quarter::first()->year(1995);
Quarter::first()->asPeriod();
//July 1, YYYY - September 30, YYYY
Quarter::first()->toFiscal();
// example, say today's date is May 1, 2022.
// this means that we are in Q2 of the calendar year 2022
// but in Q4 of Fiscal Year 2021
// to get the first quarter of the current fiscal year, you can do this:
//July 1, 2021 - September 30, 2021
Quarter::first()->year(Quarter::getCurrentFiscalYear())->toFiscal();
//July 1, 1995 - September 30, 1995
Quarter::first()->year(1995)->toFiscal();
//July 1, 1995 - September 30, 1995
Quarter::first()->year(1995)->toFiscal()->asPeriod();