lee/carbon-extended

A extended date time format helper for Carbon

v1.0 2020-02-20 04:09 UTC

This package is auto-updated.

Last update: 2024-11-23 03:58:14 UTC


README

Build Status Coverage Status StyleCI

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 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

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...)

References

SAS date documentation