2017 © Pedro Peláez
 

library alteredcarbon

Carbon extended library with AltSO-8601 support

image

mossengine/alteredcarbon

Carbon extended library with AltSO-8601 support

  • Wednesday, July 4, 2018
  • by brenmoss
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

AlteredCarbon

Latest Stable Version Latest Unstable Version License composer.lock, (*1)

Build Status codecov, (*2)

Total Downloads Monthly Downloads Daily Downloads, (*3)

This Library extends the Carbon\Carbon class to include extra support for other DateTime formats and in particular the AltSO8601 datetime format., (*4)

Functions

__constructor()

<?php
$stringAltSO8601 = '20180215135543:Australia/Brisbane';

$alteredCarbon = new Mossengine\AlteredCarbon\AlteredCarbon($stringAltSO8601);

$alteredCarbon->toDateTimeString();
// -> 2018-02-15 13:55:43

$alteredCarbon->getTimezone()->getName();
// -> Australia/Brisbane

createFromAltSO8601()

<?php
$stringAltSO8601 = '20180215135543:Australia/Brisbane';

$alteredCarbon = Mossengine\AlteredCarbon\AlteredCarbon::createFromAltSO8601($stringAltSO8601);

$alteredCarbon->toDateTimeString();
// -> 2018-02-15 13:55:43

$alteredCarbon->getTimezone()->getName();
// -> Australia/Brisbane

toAltSO8601String()

<?php
$stringDateTime = '2018-02-15 13:55:43';
$stringTimeZone = 'Australia/Brisbane';

$alteredCarbon = new Mossengine\AlteredCarbon\AlteredCarbon($stringDateTime, $stringTimeZone);

$alteredCarbon->toAltSO8601String();
// -> 20180215135543:Australia/Brisbane 

Installation

With Composer

$ composer require mossengine/alteredcarbon
{
    "require": {
        "mossengine/alteredcarbon": "~1.0.0"
    }
}
<?php
require 'vendor/autoload.php';

use Mossengine\AlteredCarbon\AlteredCarbon;

printf("AltSO8601 Now: %s", AlteredCarbon::now()->toAltSO8601String());

Without Composer

Why are you not using composer? Download AlteredCarbon.php from the repo and save the file into your project path somewhere., (*5)

<?php
require 'path/to/AlteredCarbon.php';

use Mossengine\AlteredCarbon\AlteredCarbon;

printf("AltSO8601 Now: %s", AlteredCarbon::now()->toAltSO8601String());

The Versions

04/07 2018

dev-master

9999999-dev https://github.com/Mossengine/AlteredCarbon

Carbon extended library with AltSO-8601 support

  Sources   Download

GPL-3.0-only

The Requires

 

The Development Requires

by Brendon Moss

date carbon time datetime timezone daylight altso-8601

17/02 2018

v1.1.4

1.1.4.0 https://github.com/Mossengine/AlteredCarbon

Carbon extended library with AltSO-8601 support

  Sources   Download

GPL-3.0-only

The Requires

 

The Development Requires

by Brendon Moss

date carbon time datetime timezone daylight altso-8601