# Display Dates in German

**URL:** <https://forum.getkirby.com/t/display-dates-in-german/34334>\
**Category:** Questions\
**Tags:** v4\
**Created:** [June 30, 2025, 5:02pm UTC](https://forum.getkirby.com/t/display-dates-in-german/34334 "2025-06-30T17:02:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![allthethings](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/allthethings/32/14979_2.png) [@allthethings](https://forum.getkirby.com/u/allthethings)\
**Post date:** [June 30, 2025, 5:02pm UTC](https://forum.getkirby.com/t/display-dates-in-german/34334/1 "2025-06-30T17:02:41Z")

</div>

Hi, on a site that is almost finished I’d like to output the dates in german vs. english.  
I could swear the dates were in german before. But maybe I’ve put this off until the last moment.

I don’t want to use `'handler' => 'intl'` since this would force me to update all sort of aspects of the site, since it’s date heavy.

I’ve tried to apply this in the config.php:

```
'languages' => [
    'detect' => true
],

'locale' => 'de_CH.utf8',

'date' => [
	'handler' => 'date',
	 'weekday' => 1 // will only work in kirby 5.x
],

```

I’ve checked in the terminal with `locale -a` if my locale is available. Which it is.

Is there a **simple** way to convert for instance this portion of code into german, without using the `intl` syntax?

```
<h3 class="h1">
    <?= $date->date()->toDate('d.') ?>
    <span style="font-size: 19px"><?= $date->date()->toDate('F Y') ?></span>
</h3>
<p>
    <?= $date->date()->toDate('l') ?>
    <?= $date->timeStart()->toDate('H:i') ?> – <?= $date->timeEnd()->toDate('H:i') ?><br>
    <?= $date->spots()->toInt(); ?> freie Plätze<br>
    <?= $projectTitle ?>
</p>

```

It’s a single language page at the moment.  
I don’t mind ALL dates beeing in german!

Any help highly appreciated!

Sorry: I’ve forgot some essential details:

```
"kirby": "4.7.1",
"php": "8.3.22",
"server": "LiteSpeed",
"license": "Kirby Enterprise",
"languages": []

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 30, 2025, 6:08pm UTC](https://forum.getkirby.com/t/display-dates-in-german/34334/2 "2025-06-30T18:08:39Z")

</div>

You can use the IntlDateFormatter without using intl in the config, example:

```php
$dateFormatter = new IntlDateFormatter( "de_DE" ,IntlDateFormatter::LONG, 0,
    'Europe/Berlin');
echo $dateFormatter->format($page->date()->toDate());

```

Check out the PHP docs for details: [PHP: IntlDateFormatter::create - Manual](https://www.php.net/manual/en/intldateformatter.create.php)

---

<div class="post-metadata">

**Author:** ![allthethings](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/allthethings/32/14979_2.png) [@allthethings](https://forum.getkirby.com/u/allthethings)\
**Post date:** [July 1, 2025, 9:17am UTC](https://forum.getkirby.com/t/display-dates-in-german/34334/3 "2025-07-01T09:17:10Z")

</div>

Ok, that was the motivation I needed. I knew this was possible but I thought there might be an easier way.

The Problem with my code was that `->toDate('F Y')` (F equals Month) and `<?= $date->date()->toDate('l') ?>` (l equals Day) were displayed in english. So to correct this situation I’ve created two intl date formatters and replaced them in the code.

The result looks like this:

```
<?php
    // Um daten in verschiedenen Sprachen darzustellen, muss man entweder in config.php date auf 'handler' => 'intl' stellen oder temporär auf intl umschalten (wie hier)
    // formatter für Monat
    $monthFormat = new IntlDateFormatter('de_DE', IntlDateFormatter::NONE, IntlDateFormatter::NONE, 'Europe/Zurich', IntlDateFormatter::GREGORIAN, 'MMMM' /* voller Monatsname */ );
    // formatter für Wochentag
    $dayFormat = new IntlDateFormatter( 'de_DE', IntlDateFormatter::NONE, IntlDateFormatter::NONE, 'Europe/Zurich', IntlDateFormatter::GREGORIAN, 'EEEE' /* voller Wochentagsname */ );
    $dateToFormat = $date->date()->toDate();
?>
<h3 class="h1">
    <?= $date->date()->toDate('d.') ?>
    <span style="font-size: 19px"><?= $monthFormat->format($dateToFormat); ?> <?= $date->date()->toDate('Y') ?></span>
</h3>
<p>
    <?= $dayFormat->format($dateToFormat) ?>
    <?= $date->timeStart()->toDate('H:i') ?> – <?= $date->timeEnd()->toDate('H:i') ?><br>
    <?= $date->spots()->toInt(); ?> freie Plätze<br>
    <?= $projectTitle ?>
</p>

```

Finally it was less work than I’ve thought.

Thanks a lot Sonja!
