Date notation/format working every language, except one

Hi All!

I have a strange case and I can not find the reason (or solution).
I have a multi language/locale website. When I change the locale, the notation of the date changes with it. As stated here: https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html#localizing-dates-and-numbers

So In French, I see a date like this: 01/06/2020 and when I change to German, it is this: 01.06.20 and in Dutch it is 01-06-2020 . Perfect!

But when I upload the project to my webserver, I encounter a problem: All languages behave as expected, except for one (Dutch). So I think there might be something wrong with the server? But I can not figure out what (what to look for, what to Google).

So my question is: Does anybody have an idea? Is it my server? Is it something else?
Help is much appriciated (have been struggeling for 3 days now).

THX!

Could it be a case change in some name? Possibly your local server and production server handle miss-matched case differently.

Check the version of ICU that PHP is built with.

This is an old question I posted myself. I still haven’t figured out the reason, but fixed it another way. Maybe someone is helped by my solution, so thats why (after a year) I reply to my own question.

In bootstrap.php (in the config folder, where routes.php and app.php are also located) I added the following:

if(I18n::getLocale()=='nl'){
    Cake\I18n\Date::setToStringFormat('dd-MM-yyyy');
    Cake\I18n\FrozenDate::setToStringFormat('dd-MM-yyyy');
    Cake\I18n\Time::setToStringFormat('dd-MM-yyyy (HH:mm)');
    Cake\I18n\FrozenTime::setToStringFormat('dd-MM-yyyy (HH:mm)');
    Cake\I18n\Number::config('nl', \NumberFormatter::CURRENCY, [
        'pattern' => '¤ #,##0.00;-¤ #,##0.00',
    ]);
}

This overrides the server date-format and worked for me.

Ciao!