is there a way to display a human readable difference between a date and now ?
I know DifferenceFormatter and try

$df = new DifferenceFormatter();
$text = $df->diffForHumans(FrozenTime::now()->modify(“+1 day +2 hours”),null);

that displays ‘1 day from now’ but I want to be able to internationalize this or simply personalize it (remove from now, translate in french, be able to choose if I want to display day, hour, minute,seconds)


\Cake\Chronos\DifferenceFormatter isn’t localizable, it’s general purpose functionality, \Cake\I18n\RelativeTimeFormatter is the one that is meant to be used for localization.

CakePHP’s i18n tool will extract the relevant message IDs for translation of the relative time formatter messages: