Problem translating month names

strftime relies on the OS level locale settings and language packs. Looks like your server doesn’t have the German language packs installed. Besides this, I’d recommend against the use of strftime as it has been deprecated as of PHP 8.1.

The good news is that you can use the IntlDateFormatter class. That uses language packs that come (as far as I understand it) bundled with PHP, so you don’t rely on OS functionality that changes from machine to machine.

The even better news is that Kirby 3.6.5 comes with support for the IntlDateFormmater stuff, you just have to configure it. Add this to your config:

return [
    'date'  => [
        'handler' => 'intl'
    ]
];

Then format your date like this:

<?= $entry->date()->toDate('MMMM y') ?>

The pattern uses the ICU style: Formatting Dates and Times - ICU Documentation

1 Like