New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

rtuin/carbon-normalizer

Normalizes to (and from) Carbon and native DateTime objects
49,045 2
Install
composer require rtuin/carbon-normalizer
Latest Version:v0.2.0
License:MIT
Last Updated:Aug 16, 2023
Links: GitHub  ·  Packagist
Maintainer: rtuin

Carbon+DateTime Normalizer

This is a Normalizer for the Symfony Serializer package that supports normalizing to and from Carbon, CarbonImmutable, Illuminate\Support\Carbon, DateTime and DateTimeImmutable.

Usage example

$normalizer = new \Rtuin\Normalizer\CarbonDateTimeNormalizer();

$normalized = $normalizer->normalize(\Carbon\CarbonImmutable::now());
// $normalized is now a string '2019-05-28T07:25:00+02:00'


$result = $normalizer->denormalize('2019-05-28T07:25:00+02:00', CarbonImmutable::class);
// $result is now a CarbonImmutable instance

License

The MIT License (MIT). Please see License File for more information.

Related Packages

curly_sanders/carbon-normalizer

Normalizes to (and from) Carbon and native DateTime objects

1,301 0
lastdragon-ru/lara-asp-serializer

Provides a customizable wrapper around the Symfony Serializer Component to use i...

95,750 0
kylekatarnls/laravel-carbon-2

Carbon 2 adapter for Laravel

1,284,232 63
orhan-proven/laravel-serializer

An integration of JMS Serializer with Laravel!

6 0
fruitcake/php-cors

Cross-origin resource sharing library for the Symfony HttpFoundation

331,211,453 317

Version History

Version Released License
v0.2.0 MIT
v0.1.2 MIT
v0.1.1 MIT
v0.1.0 MIT