datetime in email

Hello everyone,

I need to modify how a date is displayed in an email using a date-time variable.
I’m using the following line, but nothing is being displayed:

{{ contact.rdv_cp | format_datetime(“dd/MM/yyyy HH:mm:ss”) }}

Has anyone encountered this issue before?
Thanks a lot for your help!

Hey, @DANFROY :waving_hand: One thing to check — are you using a HubL filter or function? It’s an important distinction as “You can apply HubL filters to personalization tokens, such as contact and company tokens, on HubSpot CMS and blog pages, but not in emails.” — source

Have you tried something like this?

{{ format_datetime(contact.rdv_cp, "dd/MM/yyyy HH:mm:ss", local_time_zone) }}

which uses the HubL filter `format_datetime` instead?

Talk soon! — Jaycee

Voici la traduction en anglais :


Hello, and thank you very much for taking the time to respond.

Unfortunately, it seems that it’s not possible to use Hubl with custom variables in emails, only on landing pages.