betelgeyzua / format-date
There is no license information available for the latest version (v1.0.2) of this package.
Otus home work #4
v1.0.2
2022-02-21 20:29 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2024-09-22 02:01:41 UTC
README
Date Convert
A small library to convert a date string in date in words, multi language RU, UA, EN.
Require this package with composer.
composer require betelgeyzua/format-date
Simple Usage
The original date string must be supplied in the date format ('01-01-2022', '01.01.2022', etc.).
An example usage is shown below:
use Betelgeyzua\FormatDate\DateFormatter; $formatter = new DateFormatter(); // Create object DateFormatter; $formatter->instance(); // returns object Betelgeyzua\FormatDate $date_in_word = $formatter->instance()->dateInWords('02.07.2022'); // returns 02 Июля 2022 default language RU $date_in_word = $formatter->instance()->dateInWords('02.07.2022', 'ua'); // returns 02 Липня 2022 $date_in_word = $formatter->instance()->dateInWords('02.07.2022', 'en'); // returns 02 July 2022