CMS Development

LexG
Mitglied

Formatting date to local time in RSS email

lösung

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 Akzeptierte Lösung
narmstrong
Lösung
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Formatting date to local time in RSS email

lösung

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

Lösung in ursprünglichem Beitrag anzeigen

6 Antworten
narmstrong
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Formatting date to local time in RSS email

lösung

 

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
Mitglied

Formatting date to local time in RSS email

lösung

Hello Narmstrong,

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


~Lex

0 Upvotes
narmstrong
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Formatting date to local time in RSS email

lösung

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
Mitglied

Formatting date to local time in RSS email

lösung

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

0 Upvotes
narmstrong
Lösung
Mitwirkender/Mitwirkende | Platinum Partner
Mitwirkender/Mitwirkende | Platinum Partner

Formatting date to local time in RSS email

lösung

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
LexG
Mitglied

Formatting date to local time in RSS email

lösung

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

0 Upvotes