espero-soft / dateformat
This Php library will help you format your dates in number of years, months, days, hours, minutes and seconds.
dev-master
2022-09-19 18:03 UTC
Requires
- php: >=7.1
This package is not auto-updated.
Last update: 2025-04-16 04:44:45 UTC
README
This Php library will help you format your dates in number of years, months, days, hours, minutes and seconds.
Getting Started
Installation
Faker requires PHP >= 7.1.
composer require espero-soft/dateformat:dev-master
Documentation
Basic Usage
Here are some examples of use
<?php use EsperoSoft\DateFormat\DateFormat; require_once "vendor/autoload.php"; // default in french $fromNow = DateFormat::fromNow(new DateTimeImmutable("2022-9-9 12:14:14")); echo $fromNow."\n"; //il y a 10 jours // in English $fromNow = DateFormat::fromNow(new DateTimeImmutable("2022-9-9 12:14:14"), "en-En"); echo $fromNow."\n"; // 10 days ago // in French $fromNow = DateFormat::fromNow(new DateTimeImmutable("2022-9-9 12:14:14"), "fr-Fr"); echo $fromNow."\n"; //il y a 10 jours