Formatting date to local time in RSS email

SOLVE
LexG
Member

Hi guys, 


I'm using imported blogs to create emails but i have one slight problem with the date format. It's formatting in English, whilst the blog is using Dutch:

 

Any suggestions on how to switch this back to Dutch? I read that it would be possible to set the date to retrieve the format from Hubspot settings, but i have no idea how to go about doing that. My code:

 

{% set blog_posts = blog_recent_posts('111111111', limit=3) %} 
{% for item in blog_posts %}

{{ item.publish_date_local_time | datetimeformat('%d %B %Y') }}

{% endfor %}
0 Upvotes
1 Accepted solution

Accepted Solutions
narmstrong
Solution
Contributor | Platinum Partner

Try this

{{ item.publish_date_localized}}

Then set your date formatting in the blog date settings 

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing

View solution in original post

6 Replies 6
narmstrong
Contributor | Platinum Partner

 

Have you checked your date/time settings in the Content Settings >> Blog >> Date Formats >> Language for Dates? I think that may fix your issue.

 

Best regards, 

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes
LexG
Member

Hello Narmstrong,

I've checked, and it is set to Dutch, which is what it should be. 


~Lex

0 Upvotes
narmstrong
Contributor | Platinum Partner

Try this

{{ item.publish_date_localized|datetimeformat('%d %B %Y') }}

 

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing
0 Upvotes
LexG
Member

Sorry, no luck... This fails to load, so it would seem.

0 Upvotes
narmstrong
Solution
Contributor | Platinum Partner

Try this

{{ item.publish_date_localized}}

Then set your date formatting in the blog date settings 

Noah Armstrong | TSL Marketing
Senior Developer
6085 Marshalee Dr| Suite 100 | Elkridge, MD 21075
Contact Us

TSL Marketing

View solution in original post

LexG
Member

That did the trick. I did set the blog settings to custom format d MMMM y, and it worked! Thanks! 

0 Upvotes