lee / carbon-extended
A extended date time format helper for Carbon
v1.0
2020-02-20 04:09 UTC
Requires
- php: >=7.2
- nesbot/carbon: ^2.28
Requires (Dev)
- phpunit/phpunit: ^8 || ^9
This package is auto-updated.
Last update: 2024-11-23 03:58:14 UTC
README
Introduction
- It can use some extended format on
Carbon::format
method
Installation
Using the composer
to install this package
composer require lee/carbon-extended:^1.0
Usage
- 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
Available extended date formats
- The customized format name is refer on SAS date format
- Here are available extended formats: (it will have more customized formats...)