# Zusatzfeld, Typ "Datum-/ Zeitfeld", Ausgabe in Mail editieren

**URL:** <https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142>\
**Category:** Shopware 6 (German)\
**Created:** [16. Juni 2023 um 15:27 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142 "2023-06-16T15:27:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas\_mg](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@andreas\_mg](https://forum.shopware.com/u/andreas_mg)\
**Post date:** [16. Juni 2023 um 15:27 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142/1 "2023-06-16T15:27:16Z")

</div>

Hallo zusammen,

ich habe ein Zusatzfeld vom Typ „Datum-/ Zeitfeld“ erzeugt. Ok.

Wenn ich mir dieses Feld dann in einer Mail ausgebe, kommt sowas:  
2023-06-29T22:00:00+00:00

Klar, Datum und Zeit, so heißt ja auch das Feld.

Ich hätt den Sonderwunsch, nur das Datum, und dann auch noch im Format dd.mm.yyyy, also z.B. 29.06.2023 auszugeben.

Also wie müsste man das im Template schreiben / anpassen / kürzen / verändern …? Geht das überhaupt? In Excel wüsst ich’s ja … aber hier … hmmm

---

<div class="post-metadata">

**Author:** ![tom\_prok](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tom\_prok](https://forum.shopware.com/u/tom_prok)\
**Post date:** [16. Juni 2023 um 15:53 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142/2 "2023-06-16T15:53:20Z")

</div>

Hallo,

eigentlich sollte das mit dem Date filter in Twig funktionieren:

> **[date - Documentation - Twig - The flexible, fast, and secure PHP template engine](https://twig.symfony.com/doc/3.x/filters/date.html)**
>
> Twig - The flexible, fast, and secure template engine for PHP

Also noch `|date('DD.MM.YYYY')` in die Ausgabe des Zusatzfelds hinzufügen.

Viele Grüße  
Tom

---

<div class="post-metadata">

**Author:** ![andreas\_mg](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@andreas\_mg](https://forum.shopware.com/u/andreas_mg)\
**Post date:** [16. Juni 2023 um 18:19 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142/3 "2023-06-16T18:19:29Z")

</div>

Super, danke Tom für den Fingerzeig, damit hat’s geklappt:

|date(„d.m.Y“)

Also:  
{{order.customFields.custom\_meineBezeichnung|date(„d.m.Y“)}}

Schönes WE!

---

<div class="post-metadata">

**Author:** ![andreas\_mg](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@andreas\_mg](https://forum.shopware.com/u/andreas_mg)\
**Post date:** [16. Juni 2023 um 18:24 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142/4 "2023-06-16T18:24:23Z")

</div>

Oh, sehr grad, die Formatierung der Gänsefüßchen wurde nicht richtig übernommen. Einfach auf den Link oben gehen, auf der Seite ist es richtig abgebildet … für die, die vor dem gl. Problem stehen …

…Ich schau gl. mal … gib bestimmt auch ein Plugin hier für’s Forum, was solche Dinge geradebiegen kann …

---

<div class="post-metadata">

**Author:** ![drakon](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/drakon/32/7724_2.png) [@drakon](https://forum.shopware.com/u/drakon)\
**Post date:** [16. Juni 2023 um 23:08 UTC](https://forum.shopware.com/t/zusatzfeld-typ-datum-zeitfeld-ausgabe-in-mail-editieren/100142/5 "2023-06-16T23:08:49Z")

</div>

Code einfach als vorformatierten Text einfügen (\</\>):

```auto
{{order.customFields.custom_meineBezeichnung|date("d.m.Y")}}

```
