New

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

fridzema/laravel-date-format-converter

Converts date format from js to php and the other way around
1,250 1
Install
composer require fridzema/laravel-date-format-converter
Latest Version:0.0.3
PHP:^8.2
Laravel:10 – 13
License:MIT
Last Updated:Mar 20, 2026
Links: GitHub  ·  Packagist
Maintainer: fridzema

Converts date format from js to php and the other way around

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Really simple package to convert js date format to php date format and the other way around.

    use Fridzema\DateFormatConverter\DateFormatConverter;

    it('converts JavaScript date formats to PHP date formats', function () {
        expect(DateFormatConverter::convertJsFormatToPhp('YYYY-MM-DD'))->toEqual('Y-m-d');
    });

    it('converts PHP date formats to JavaScript date formats', function () {
        expect(DateFormatConverter::convertPhpFormatToJs('Y-m-d'))->toEqual('YYYY-MM-DD');
    });

Installation

You can install the package via composer:

composer require fridzema/laravel-date-format-converter

You can publish the config file with:

php artisan vendor:publish --tag="laravel-date-format-converter-config"

Usage

$dateFormatConverter = new Fridzema\DateFormatConverter();

echo DateFormatConverter::convertPhpFormatToJs('Y-m-d');
echo DateFormatConverter::convertJsFormatToPhp('YYYY-MM-DD');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

Related Packages

gorkau/laravel-format

Laravel Format

13 0
pwweb/copper

An API extension for NumberFormatter.

1,234 0
guojikai/plunar

一个PHP版中国阴历转换工具,用于将阳历日期转换为中国阴历日期。(支持 Composer)

595 23
flobbos/laravel-datable

A tiny Laravel package for easily switching localized dates

176 1

Version History

Version Released PHP Laravel License
0.0.3 ^8.2 ^10.0||^11.0|^12.0|^13.0 MIT
0.0.2 ^8.2 ^10.0||^11.0|^12.0 MIT
0.0.1 ^8.2 ^10.0||^11.0 MIT