APIs & Integrations

TSharma55
Membre

custom date format for blog post

Résolue

{{ rec_post.publish_date|datetimeformat('%B %e, %Y')}}
I am using this in blog post which is rendering December 12, 2024.

But can we get the customize date format from which I get
Dec 12, 2024 >

0 Votes
1 Solution acceptée
JTBuys
Solution
Contributeur | Partenaire solutions Platinum
Contributeur | Partenaire solutions Platinum

custom date format for blog post

Résolue

@TSharma55, that filter has been deprecated. I recommend using the hubl below. This hubl uses the format_date filter which is based on unicode LDML patterns. The MMM portion will format the month in the abbreviated style you want.

 

{{rec_post.publish_date|format_date('MMM d, y')}}

 

Voir la solution dans l'envoi d'origine

1 Réponse
JTBuys
Solution
Contributeur | Partenaire solutions Platinum
Contributeur | Partenaire solutions Platinum

custom date format for blog post

Résolue

@TSharma55, that filter has been deprecated. I recommend using the hubl below. This hubl uses the format_date filter which is based on unicode LDML patterns. The MMM portion will format the month in the abbreviated style you want.

 

{{rec_post.publish_date|format_date('MMM d, y')}}