The setlocale
function returns false
if the locale couldn't be set, and you are ignoring the return value. In this case the call must be failing (possibly because the de_DE
locale isn't installed?) and strftime
still formats dates in English.
On the other hand, the day 0 corresponds to the "last day of the month before". So mktime
is returning April 30, not May 1 if that's what you expect. For May 1 use this:
mktime(0,0,0, $date_array[0], 1, $date_array[1])