- It can use some extended format on
Carbon::format
method
Using the composer
to install this package
composer require lee/carbon-extended:^1.0
- The
CarbonExtended
class extendsCarbon
and it can usecreateFromFormat
to create theCarbon
class instance and do format with extended foramts.
use Lee\CarbonExtended;
$date = '2013-03-17';
$customizedFormat = 'QTR.';
$carbonExtended = CarbonExtended::createFromFormat('Y-m-d', $date);
$result = $carbonExtended->extendedFormat($customizedFormat); // 1
- The customized format name is refer on SAS date format
- Here are available extended formats: (it will have more customized formats...)
customized format name | references |
---|---|
QTR. | QTR. reference |
QTRR. | QTRR. reference |
JULDAY3. | JULDAY3. reference |
SAS_DATE_VALUE | SAS_DATE_VALUE reference |
JULIAN5. | JULIAN5. reference |
JULIAN7. | JULIAN7. reference |
PDJULG4. | PDJULG4. reference |
TIMEAMPM. | TIMEAMPM. reference |