Setlocale() doesn't work

In my testing environment, I’m trying to output dates in my own language (Dutch). I do this with the PHP-function strftime() and by using setlocale().

But somehow Local doesn’t seem to support changes through setlocale, the setlocale value stays at ‘C’, after trying to change it. How to do this, so I can properly test this part of my code?

    /* Set locale to Dutch */
   setlocale(LC_ALL, 'nl_NL');

   /* Output: vrijdag 22 december 1978 */
   echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));

This should output ‘vrijdag 22 december 1978’, but I get ‘Friday 22 December 1978’.

I confirm it, I have the same problem with setlocale(), and I can’t figure it out.

1 Like

@Flywheel, is there any way to change the time settings for a Local installation?
Or for the whole installation?

This is very problematic when writing functions that depend on dates, a solution or workaround is needed.