Strftime localization issue


I’ve got a curious problem with strftime and languages - on my locale machine with XAMPP the date / time for the articles work fine, but not at the webspace. So if I read any article on the locale webserver I have the correct Date:
DE: Donnerstag, 08.08.2019
EN: Thursday, 8/8/2019

but on the Webserver I have
DE: Thursday, 8/8/2019
EN: Thursday, 8/8/2019

My config.php:

return [
	'locale' => 'de_DE.utf-8',
	'date.handler' => 'strftime',
	'languages' => true,
	'languages.detect' => true,

My article.php:

<time datetime="<?= $page->date()->toDate('c') ?>" pubdate="pubdate">
  <?= $page->date()->toDate('%A, %Ex') ?>

At this point i am not sure if there is a problem in the sourcecode, or if the webserver on which the website is hosted can’t deal with this.


The correct locale setting might be different on the remote host. Often, the differences are not big but enough to not make it work.

Do you have ssh access to your host? Then you can use terminal and type

locale -a

to get a list of the installed locales.

locale: Command not found.

Hm, that’s a pretty standard linux command…

You could try some alternatives to your dev locale:


no changes :frowning:

Where is the site hosted?


Hm :thinking:, you could try a few other variations


or contact their support.

What you get when add following codes? Maybe it’il help about information after setting locale.

Add to site/controllers/home.php or any file in kirby

$currentLocale = setlocale(LC_ALL, 0);
echo $currentLocale;

What you could also try in any template:


Should do the same as locale - on the command line and print out a list of available locales.

localhost: de_DE
Webserver: /de_DE/C/C/C/C/C

Works for me and my locale output like that:


Have you tried my last suggestion, @felixhuth?

Upload following codes to your server root like: setlocale.php and run.
If it doesn’t work, contact your hosting provider.

setlocale(LC_TIME, "de_DE.utf8");
echo strftime("In German %A.\n");

I’ve tried it - it worked :confused:

I will try it at my test environment - it is hostet at 1und1 IONOS, so i will tell you about the results in a few days :slight_smile:

The website is now online at a dev environment at 1und1 IONOS - same problem…

@texnixe in which template (i.e. file) and where i have to insert this code?

You can insert that code anywhere, e.g. in the home.php template.

Class ‘ResourceBundle’ not found …

Hm, ok, that class doesn’t seem to be included in your PHP then, what a shame.

Stop, I just realised you are using languages, right? So the locale should be defined in the language files…

What do you have there?