danharrin/date-format-converter
Convert date format strings between PHP, Moment.js, and other common tokens. Handy for keeping Laravel backends and JavaScript frontends in sync when parsing, formatting, or validating dates across different libraries and locales.
This package allows you to convert token-based date formats between standards.
You can use Composer to install this package into your application:
composer require danharrin/date-format-converter
Use the convert_date_format() method to initialise a new instance of the converter, ready to use:
convert_date_format('Y-m-d H:i:s')->to('day.js');
// YYYY-MM-DD HH:mm:ss
convert_date_format('Y-m-d H:i:s')->to('moment.js');
// YYYY-MM-DD HH:mm:ss
🐞 If you spot a bug with this package, please submit a detailed issue, and wait for assistance.
🤔 If you have a question or feature request, please start a new discussion.
🔐 If you discover a vulnerability within the package, please review our security policy.
How can I help you explore Laravel packages today?