Forum Discussion

stella_issupow's avatar
stella_issupow
Active Member II
2 years ago

How to change the date format in an email using liquid

Hi everybody, greetings from Germany!

I want to display the date format of a custom property in an email in a different way.

In the propery, we save the date in this format: YYYY-MM-DD hh:mm:ss.

I'd like to display the property in the email in this format: DD.MM.YYYY

Does anybody know how I can achieve that?

Thanks so much for your support!

  • Hey Stella, 

    Try this:

    {{event_properties.${datepropertyname} | date: "%d.%m.%Y" }}

    It's the same syntax for custom attributes, just add "|" after the first closing curly bracket and define the format of the date attribute. 

3 Replies

  • Arso's avatar
    Arso
    Practitioner III

    Hey Stella, 

    Try this:

    {{event_properties.${datepropertyname} | date: "%d.%m.%Y" }}

    It's the same syntax for custom attributes, just add "|" after the first closing curly bracket and define the format of the date attribute.