<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to format date property with HubL in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209183#M44261</link>
    <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/974963"&gt;@Anders_Grové&lt;/a&gt;&lt;/SPAN&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for posting to the Community!&lt;BR /&gt;&lt;BR /&gt;I understand that you’re having trouble displaying just the day from a datetime property in HubL using the new format_date or format_datetime filters, since CRM record datetime properties are strings rather than PyishDate objects, and you’re seeking a pure HubL solution for parsing and formatting these values.&lt;BR /&gt;&lt;BR /&gt;I'd like to tag in some of our Top Contributors to see if they have any advice here -- Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/341938"&gt;@MBERARD&lt;/a&gt; &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt; and &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/78983"&gt;@Indra&lt;/a&gt; Do any of you have any tips or tricks for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/974963"&gt;@Anders_Grové&lt;/a&gt;&lt;/SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;Cassie, Community Manager&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Oct 2025 11:54:56 GMT</pubDate>
    <dc:creator>chighsmith</dc:creator>
    <dc:date>2025-10-07T11:54:56Z</dc:date>
    <item>
      <title>How to format date property with HubL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209163#M44260</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;I am looking for a working example of the&amp;nbsp;format_date or&amp;nbsp;format_datetime filters.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to display just the day of a datetime property. We used to be able to do this with the deprecated filter&amp;nbsp;|datetimeformat("%d"). Now we have the new |&lt;SPAN&gt;format_datetime filter - but nothing I try can make this work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The only working example I could find was on the &lt;A href="https://github.com/HubSpot/cms-elevate-theme-public/blob/main/src/unified-theme/templates/blog-detail.hubl.html" target="_blank" rel="noopener"&gt;blog template&lt;/A&gt; of the Elevate theme in HubSpot github:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{{ content.publish_date|format_date('long') }}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I used pprint to check this property type it showed that the blog date type is actually:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(PyishDate: 2025-05-19 22:00:00)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datetime type properties we get from crm records are &lt;EM&gt;string&lt;/EM&gt; type, which seems to me like the issue. Is there a parse function that converts to&amp;nbsp;PyishDate type - not finding anything on this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a pure HubL solution, I'm aware you can do this with javascript.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have a clue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 10:53:04 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209163#M44260</guid>
      <dc:creator>Anders_Grové</dc:creator>
      <dc:date>2025-10-07T10:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date property with HubL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209183#M44261</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/974963"&gt;@Anders_Grové&lt;/a&gt;&lt;/SPAN&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for posting to the Community!&lt;BR /&gt;&lt;BR /&gt;I understand that you’re having trouble displaying just the day from a datetime property in HubL using the new format_date or format_datetime filters, since CRM record datetime properties are strings rather than PyishDate objects, and you’re seeking a pure HubL solution for parsing and formatting these values.&lt;BR /&gt;&lt;BR /&gt;I'd like to tag in some of our Top Contributors to see if they have any advice here -- Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/341938"&gt;@MBERARD&lt;/a&gt; &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt; and &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/78983"&gt;@Indra&lt;/a&gt; Do any of you have any tips or tricks for &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/974963"&gt;@Anders_Grové&lt;/a&gt;&lt;/SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;Cassie, Community Manager&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 11:54:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209183#M44261</guid>
      <dc:creator>chighsmith</dc:creator>
      <dc:date>2025-10-07T11:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date property with HubL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209255#M44262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/974963"&gt;@Anders_Grové&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Since you’re getting a string instead of a Date object, the filter can’t properly convert the date.&lt;/P&gt;
&lt;P&gt;What I’d suggest is applying the &lt;EM&gt;&lt;A href="https://developers.hubspot.com/docs/cms/reference/hubl/filters#strtotime" target="_blank"&gt;strtotime&lt;/A&gt;&lt;/EM&gt; filter first, and then formatting your date.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Matthieu BERARD&lt;/P&gt;</description>
      <pubDate>Tue, 07 Oct 2025 14:40:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209255#M44262</guid>
      <dc:creator>MBERARD</dc:creator>
      <dc:date>2025-10-07T14:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date property with HubL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209713#M44266</link>
      <description>&lt;P&gt;Ah such an easy solve, didn't spot that filter. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, I also found another solution by adding a 'false' parameter on the crm_objects function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Community FTW!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 10:09:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209713#M44266</guid>
      <dc:creator>Anders_Grové</dc:creator>
      <dc:date>2025-10-08T10:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date property with HubL</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209752#M44269</link>
      <description>&lt;P&gt;Good to know about the crm_objects function — thanks for sharing!&lt;BR /&gt;Happy coding!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2025 12:29:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-format-date-property-with-HubL/m-p/1209752#M44269</guid>
      <dc:creator>MBERARD</dc:creator>
      <dc:date>2025-10-08T12:29:26Z</dc:date>
    </item>
  </channel>
</rss>

