Carbon::format
methodUsing the composer
to install this package
composer require lee/carbon-extended:^1.0
CarbonExtended
class extends Carbon
and it can use createFromFormat
to create the Carbon
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
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 |