0

Why cant I get the weekdays in danish (mandag, tirsdag...) when I get the date from MySQL?

$Weekday = date('l', strtotime($Date));

echo " - $Weekday";

I have tryed to set locale settings, but it dosn't work? It only returns in english.

user2996395
  • 171
  • 1
  • 2
  • 10
  • 1
    Possible duplicate of [PHP Date function output in Italian](http://stackoverflow.com/questions/1114488/php-date-function-output-in-italian) – swidmann Oct 02 '15 at 13:00

1 Answers1

0

The locale does not affect date() function, you should use strftime() and set the locale like this:

setlocale(LC_ALL, 'Portuguese');
echo strftime('%A');

Other options are:

gmstrftim

Carbon lib

IntlDateFormatter

rray
  • 2,518
  • 1
  • 28
  • 38