date language | WordPress.org

[ad_1]

I get the correct language output (in my case: German) when using: the_modified_time(‘d. F Y’);

But when I do something like this:

$moddate = ‘27.07.2023’;
$moddate = DateTime::createFromFormat(‘d.m.Y’, $moddate);
echo $moddate->format(‘d. F Y’);

… the output language is English = 27. July 2023 instead of the German 27. Juli 2023.

I can’t find any reason why the language setting that works for the_modified_time() does not apply to $moddate->format(‘d. F Y’);

It’s probably more a PHP than a WP question, but still hope for some help …

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer