# Problem with datetimeformat in HubL

**URL:** <https://community.hubspot.com/t/problem-with-datetimeformat-in-hubl/1462>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [April 3, 2017, 10:25pm UTC](https://community.hubspot.com/t/problem-with-datetimeformat-in-hubl/1462 "2017-04-03T22:25:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimoneM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonem/32/53612_2.png) [@SimoneM](https://community.hubspot.com/u/SimoneM)\
**Post date:** [April 3, 2017, 10:25pm UTC](https://community.hubspot.com/t/problem-with-datetimeformat-in-hubl/1462/1 "2017-04-03T22:25:07Z")

</div>

Hi, this is a code of one our HubL:

\<h3\>Ultimi articoli sul blog\</h3\>  
{% set rec\_posts = blog\_recent\_posts(‘default’, 3) %}  
\<ul\>  
{% for rec\_post in rec\_posts %}  
\<li\>  
\<div class=“left-col”\>  
{% if rec\_post.featured\_image %}  
\<div class=“hs-featured-image-wrapper”\>  
\<a href=“{{rec\_post.absolute\_url}}” title=“” class=“hs-featured-image-link” alt=“{{ rec\_post.name }}”\>  
\<img src=“{{ rec\_post.featured\_image }}” alt=“{{ rec\_post.name }}”\>  
\</a\>  
\</div\>  
{% endif %}  
\</div\>  
\<div class=“right-col”\>  
\<h3\>\<a href=“{{ rec\_post.absolute\_url }}”\>{{ rec\_post.name }}\</a\>\</h3\>  
\<span class=“display-date”\>\<i class=“mkdff-icon-simple-line-icon icon-calender”\>\</i\>\<span\>{{ content.publish\_date\_local\_time | datetimeformat (‘%e-%b-%Y’) }}\</span\>\</span\>  
\</div\>  
\</li\>  
{% endfor %}  
\</ul\>

With this code, on the bottom of this site: [http://www.effettodomino.social/](http://www.effettodomino.social/) all the blog posts seem that are published on 26 July 2016

 ![Screenshot_1.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/0/303277bac086b013c957cca6f999d890d8d70e7f.png)

What can be the problem?

Thank you

---

<div class="post-metadata">

**Author:** ![DaniellePeters](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/daniellepeters/32/6115_2.png) [@DaniellePeters](https://community.hubspot.com/u/DaniellePeters)\
**Post date:** [April 4, 2017, 2:41pm UTC](https://community.hubspot.com/t/problem-with-datetimeformat-in-hubl/1462/2 "2017-04-04T14:41:27Z")

</div>

You need to use

`{{ rec_post.publish_date_local_time | datetimeformat ('%e-%b-%Y') }}`

instead of

`{{ content.publish_date_local_time | datetimeformat ('%e-%b-%Y') }}`

because you are looping through “rec\_post in rec\_posts” not “content in contents”

---

<div class="post-metadata">

**Author:** ![SimoneM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/simonem/32/53612_2.png) [@SimoneM](https://community.hubspot.com/u/SimoneM)\
**Post date:** [April 4, 2017, 4:40pm UTC](https://community.hubspot.com/t/problem-with-datetimeformat-in-hubl/1462/3 "2017-04-04T16:40:43Z")

</div>

Thank you very much indeed, it works

Best,

Simone
