# DifferenceFormatter

**URL:** <https://discourse.cakephp.org/t/differenceformatter/10986>\
**Category:** Need Help\
**Created:** [February 28, 2023, 1:26pm UTC](https://discourse.cakephp.org/t/differenceformatter/10986 "2023-02-28T13:26:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![electoonix](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@electoonix](https://discourse.cakephp.org/u/electoonix)\
**Post date:** [February 28, 2023, 1:26pm UTC](https://discourse.cakephp.org/t/differenceformatter/10986/1 "2023-02-28T13:26:04Z")

</div>

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)

Thanks

---

<div class="post-metadata">

**Author:** ![ndm](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/ndm/32/2234_2.png) [@ndm](https://discourse.cakephp.org/u/ndm)\
**Post date:** [February 28, 2023, 3:06pm UTC](https://discourse.cakephp.org/t/differenceformatter/10986/2 "2023-02-28T15:06:13Z")

</div>

`\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**](https://book.cakephp.org/4/en/console-commands/i18n.html) will extract the relevant message IDs for translation of the relative time formatter messages:

> <https://github.com/cakephp/localized/blob/4.1.0/resources/locales/fr_FR/cake.po#L80-L208>
