Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8037005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:47:48+00:00 2026-06-05T02:47:48+00:00

The setlocale() function doesn’t set the desired language (German). The goal is to output

  • 0

The setlocale() function doesn’t set the desired language (German).


The goal is to output month names.

This is my test code with trials so far:

<?php

date_default_timezone_set('Europe/Berlin');
setlocale(LC_ALL, 'de_DE.utf8');
// Or
setlocale(LC_ALL, 'de_DE@euro');
// Or
setlocale(LC_ALL, 'de_DE');
// Or
setlocale(LC_ALL, 'de');
// Or
setlocale(LC_ALL, 'ge');


echo strftime('%B');

Output:

June

instead of

Juni

Any suggestions?

  • I don’t have ssh or other shell access.
  • The script is running on a linux server.

PHP version 5.6

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:47:50+00:00Added an answer on June 5, 2026 at 2:47 am

    This solution might help if you don’t have shell access to the server.

    If you have shell access, then Benjamin Seiller’s answer is the best!

    As I don’t have any other possibilities (shell), I’ve found a solution with only PHP by using the IntlDateFormatter class.

    <?php
    
    // Example vars
    $month = '6';
    $year = '2014';
    
    $fmt = new IntlDateFormatter('de_DE',
        IntlDateFormatter::FULL,
        IntlDateFormatter::FULL,
        'Europe/Berlin',
        IntlDateFormatter::GREGORIAN);
    
    $lastMonth = mktime(0, 0, 0, $month -1, 1, $year);
    
    $showLastMonth =  $fmt->format($lastMonth);
    echo $showLastMonth;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this strange problem where this code: private function initLevel():void { var levelMap:Array
Why does this error occurs? code: setlocale(LC_MONETARY, en_US); $pricetotal = money_format(%10.2n, $pricetotal); Server details.
I have some code like this: resourceBundle = ResourceBundle.getBundle( com.something.whatever.txt, getLocale()); This code is
I want to fold function definitions in python code using Vim syntax based folding.
I'm trying to convert a string into money format using this function , and
I am using the following to output the full name of a month in
I've done this simple app in Gtk, just to test things out... I come
I have this code pushd C:\Folders\ for %%j in (*) do ( md %%~nj
I'm trying to get PHP dates to work cross language. The language code will
I'm using this code to convert a string to a date : +(NSDate*)dateTexteFromString:(NSString*)someString {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.