Date Picker property format in Email

Hi there,

I want to use a property called “birthday” in my marketing email. It’s field type is Date Picker. If I used it by default like

{{contact.birthday}}

it shows something like “30/11/20” which is super confusing to recipients. I want to show it in long/medium form like “30 September 2020”. I’ve tried adding it as

{{contact.birthday|format_date("long", "Pacific/Auckland", "en-NZ")}}

but when I do it returns nothing.

I would prefer if this could be done using Hubl, but if not hopefully a calculated property works? I don’t want to push 2 different properties using api for essentially the same thing, cause it’s going to be a hassle to manage properties if we want different date formats.

Kia ora @yamlnz

Have you tried using explicit Date Time e.g. “d MMMM yyyy” as seen in the Template Docs?

{{ contact.birthdate|format_date('d MMMM yyyyy') }}

If I see an unexpcted result I use pprint to debug:

{{ contact.birthday|pprint }}

You make need to create a fallback (or an “if” loop) for when the date is not know.

Have fun

Mike

Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.

Thanks for your response, @Mike_Eastwood

Yes, I have tried using “dd MMMM yyyy” and other variants, and none of them show anything. Also tried format_datetime just in case.

Have tried pprint. {{ contact.birthdate|format_date(‘d MMMM yyyyy’)|pprint }} prints nothing. While {{ contact.birthdate|pprint }} shows (String: 30/11/20). Just want to reiterate tho, the property is a “date picker” type. Honestly, I’m stumped and there really should be an easy way to do this.

Hi @yamlnz ,

I do not believe the formatting works like that in HubSpot for the date picker property. Depending on your subscription you might be able to build a custom coded workflow that would create it in a single line of text property.

That **bleep**. This is a super basic functionality for a marketing tool to have. Having another workflow would make maintenance a mess.