This package is abandoned and no longer maintained. No replacement package was suggested.

Time Diff generator

v3.1 2017-05-05 15:03 UTC

This package is auto-updated.

Last update: 2020-02-14 20:48:45 UTC


$timeDiff = new TimeDiff();
echo $timeDiff->diff('2017-03-04 20:56');

Will echo a text like "now", "5 minutes ago", "2 hours ago" etc., depending on current time.

Translations will be handled by the Micrus Localizator. If it's not present, please implement yourself a function l($word, $replacements = []) that will translate strings from files src/Translations/*.yml.