<?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: Countdown on Landing Page (Marketing Starter) in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/963978#M38730</link>
    <description>&lt;P&gt;I know this is years later, but just for the sake of anyone searching for the fix on a similar issue, you can actually use hubl and unixtimestamps to solve this. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&lt;SPAN&gt;{# The values here are not specific, so you can use non-abbreviated,translated or whatever #}&lt;BR /&gt;{% set allDaysOfWeek = ["Sun", "Mon","Tues","Wed","Thur","Fri","Sat"] %}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Next, we basically we convert the date to a unix timestamp (# of milliseconds since January 1st 1970 when the standard was established), and convert it into days which we then mod by 7 (days in the week). "%" aka "mod", gives the remainder after diving by the number it's given (i.e. 10%3 == 1).&amp;nbsp;The resulting value is the number of weekdays past that initial day: Jan 1st 1970, which was a Thursday (thus the + 4 before modding, Thursday being 4 days after Sunday, the first element in the daysOfWeek array).&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;{% set dayOfWeek = allDaysOfWeek[((((module.date|unixtimestamp)|int|float|divide(1000)|divide(60)|divide(60)|divide(24) )|round|int + 4)%7)] %}&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;The result:&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&amp;lt;p&amp;gt;{{ module.date|format_date('long') }} is a {{ dayOfWeek }}&amp;lt;/p&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Renders: February 1, 2024 is a Thursday&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;But that's based on the assumption that you're usung hubspots date-picker.&lt;BR /&gt;What if you &lt;STRONG&gt;don't&lt;/STRONG&gt; have your date in that format or instead want to find the time between two dates?&lt;BR /&gt;&lt;BR /&gt;Then first you'll need to convert both dates to unix timestamps before you subtract &lt;EM&gt;the earlier&lt;/EM&gt; from &lt;EM&gt;the later date&lt;/EM&gt;. For instance, how about a 'Days til election voting' counter? (static of course, you'll need a bit of javascript if you want an animated one. Not much though)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;{# Converting date with hubl filters so it can be 'math-i-fied'. For instance, days til election day: #}&lt;BR /&gt;{% set currentDate = local_dt|unixtimestamp %}&lt;BR /&gt;&lt;BR /&gt;{# Future Date - example of formating date to unix timestamp #}&lt;BR /&gt;{% set electionDay = ("2024-11-05T00:00:00+0530")|strtotime("yyyy-MM-dd'T'HH:mm:ssZ")|unixtimestamp %}&lt;BR /&gt;{# The "2024-11-05T00:00:00+0530" here is being converted using the |strtotime filter by passing it the format that your input date is using&lt;BR /&gt;In this case ("yyyy-MM-dd'T'HH:mm:ssZ") #}&lt;BR /&gt;&lt;BR /&gt;{% set timeDiff = ((electionDay - currentDate)|int|float|divide(1000)|divide(60)|divide(60)|divide(24))|round|int %}&lt;/PRE&gt;
&lt;P data-unlink="true"&gt;*You can find a list of all the time patterns here or use an converter if your unsure what to pass the filter: &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html" target="_blank" rel="noopener"&gt;https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The result:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&amp;lt;p&amp;gt;{{ timeDiff }} Days til Voting!&amp;lt;/p&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Renders: 198 Days til Voting!&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding hours/minute/seconds is as easy as simply stripping off the conversions from right to left --&amp;gt;&amp;nbsp;|divide(24) [&lt;STRONG&gt;hours&lt;/STRONG&gt; in a day]--&amp;gt; |divide(60) [&lt;STRONG&gt;minutes&lt;/STRONG&gt; in an hour] --&amp;gt; |divide(60) [&lt;STRONG&gt;seconds&lt;/STRONG&gt; in a minute]&amp;nbsp;--&amp;gt;&amp;nbsp; |divide(1000) [&lt;STRONG&gt;milliseconds&lt;/STRONG&gt; in a second]. Do note (as previously mentioned) that these will be static numbers only updated when refreshing the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Apr 2024 20:49:44 GMT</pubDate>
    <dc:creator>DevenD</dc:creator>
    <dc:date>2024-04-20T20:49:44Z</dc:date>
    <item>
      <title>Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322194#M15561</link>
      <description>&lt;P&gt;We want to integrate a Countdown on a Landing Page. While we are not able to implement JavaScript in the Drag and Drop Editor in this License, has anybody a creative solution how we are able to implement a Countdown in the maketing starter version?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Carolin&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 11:39:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322194#M15561</guid>
      <dc:creator>CarolinKranz</dc:creator>
      <dc:date>2020-02-27T11:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322200#M15562</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122058"&gt;@CarolinKranz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;U can create one module in Design Tools (Design Manager) to be avaliable to insert in your landing pages templates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is easy to create if you have knowledge for insert one JS code how you mention in your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look this free course in HubSpot, when teaches how create modules and templates:&amp;nbsp;&lt;A href="https://academy.hubspot.com/courses/cms-for-developers" target="_blank"&gt;https://academy.hubspot.com/courses/cms-for-developers&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did this post help solve your problem? If so, please mark it as a solution.&lt;/P&gt;
&lt;P&gt;Best regards!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 12:28:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322200#M15562</guid>
      <dc:creator>DanielSanchez</dc:creator>
      <dc:date>2020-02-27T12:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322214#M15563</link>
      <description>&lt;P&gt;But in marketing starter version I have no access to the design manager. Thats the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:35:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322214#M15563</guid>
      <dc:creator>CarolinKranz</dc:creator>
      <dc:date>2020-02-27T13:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322391#M15571</link>
      <description>&lt;P&gt;You need also "Hubspot CRM" to create modules layouts etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have query&lt;/P&gt;&lt;P&gt;feel free to contact me &lt;A href="https://www.linkedin.com/in/subhash-negi-0b4527106/" target="_blank"&gt;https://www.linkedin.com/in/subhash-negi-0b4527106/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 17:24:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322391#M15571</guid>
      <dc:creator>SSN</dc:creator>
      <dc:date>2020-02-27T17:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322399#M15573</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/122058"&gt;@CarolinKranz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately you you need upgrade plan for create modules and templates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont know if you can use marketplace to buy and download templates, but in Marketplace, have templates with countdown. Look:&amp;nbsp;&lt;A href="https://app.hubspot.com/marketplace/407592/products?searchTerm=countdown" target="_blank"&gt;https://app.hubspot.com/marketplace/407592/products?searchTerm=countdown&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If dont have access, you need upgrade plan for this too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did this post help solve your problem? If so, please mark it as a solution.&lt;/P&gt;
&lt;P&gt;Best regards!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 17:31:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/322399#M15573</guid>
      <dc:creator>DanielSanchez</dc:creator>
      <dc:date>2020-02-27T17:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Countdown on Landing Page (Marketing Starter)</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/963978#M38730</link>
      <description>&lt;P&gt;I know this is years later, but just for the sake of anyone searching for the fix on a similar issue, you can actually use hubl and unixtimestamps to solve this. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&lt;SPAN&gt;{# The values here are not specific, so you can use non-abbreviated,translated or whatever #}&lt;BR /&gt;{% set allDaysOfWeek = ["Sun", "Mon","Tues","Wed","Thur","Fri","Sat"] %}&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Next, we basically we convert the date to a unix timestamp (# of milliseconds since January 1st 1970 when the standard was established), and convert it into days which we then mod by 7 (days in the week). "%" aka "mod", gives the remainder after diving by the number it's given (i.e. 10%3 == 1).&amp;nbsp;The resulting value is the number of weekdays past that initial day: Jan 1st 1970, which was a Thursday (thus the + 4 before modding, Thursday being 4 days after Sunday, the first element in the daysOfWeek array).&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;{% set dayOfWeek = allDaysOfWeek[((((module.date|unixtimestamp)|int|float|divide(1000)|divide(60)|divide(60)|divide(24) )|round|int + 4)%7)] %}&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;The result:&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&amp;lt;p&amp;gt;{{ module.date|format_date('long') }} is a {{ dayOfWeek }}&amp;lt;/p&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Renders: February 1, 2024 is a Thursday&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;But that's based on the assumption that you're usung hubspots date-picker.&lt;BR /&gt;What if you &lt;STRONG&gt;don't&lt;/STRONG&gt; have your date in that format or instead want to find the time between two dates?&lt;BR /&gt;&lt;BR /&gt;Then first you'll need to convert both dates to unix timestamps before you subtract &lt;EM&gt;the earlier&lt;/EM&gt; from &lt;EM&gt;the later date&lt;/EM&gt;. For instance, how about a 'Days til election voting' counter? (static of course, you'll need a bit of javascript if you want an animated one. Not much though)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;{# Converting date with hubl filters so it can be 'math-i-fied'. For instance, days til election day: #}&lt;BR /&gt;{% set currentDate = local_dt|unixtimestamp %}&lt;BR /&gt;&lt;BR /&gt;{# Future Date - example of formating date to unix timestamp #}&lt;BR /&gt;{% set electionDay = ("2024-11-05T00:00:00+0530")|strtotime("yyyy-MM-dd'T'HH:mm:ssZ")|unixtimestamp %}&lt;BR /&gt;{# The "2024-11-05T00:00:00+0530" here is being converted using the |strtotime filter by passing it the format that your input date is using&lt;BR /&gt;In this case ("yyyy-MM-dd'T'HH:mm:ssZ") #}&lt;BR /&gt;&lt;BR /&gt;{% set timeDiff = ((electionDay - currentDate)|int|float|divide(1000)|divide(60)|divide(60)|divide(24))|round|int %}&lt;/PRE&gt;
&lt;P data-unlink="true"&gt;*You can find a list of all the time patterns here or use an converter if your unsure what to pass the filter: &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html" target="_blank" rel="noopener"&gt;https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The result:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="" data-stringify-type="pre"&gt;&amp;lt;p&amp;gt;{{ timeDiff }} Days til Voting!&amp;lt;/p&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Renders: 198 Days til Voting!&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding hours/minute/seconds is as easy as simply stripping off the conversions from right to left --&amp;gt;&amp;nbsp;|divide(24) [&lt;STRONG&gt;hours&lt;/STRONG&gt; in a day]--&amp;gt; |divide(60) [&lt;STRONG&gt;minutes&lt;/STRONG&gt; in an hour] --&amp;gt; |divide(60) [&lt;STRONG&gt;seconds&lt;/STRONG&gt; in a minute]&amp;nbsp;--&amp;gt;&amp;nbsp; |divide(1000) [&lt;STRONG&gt;milliseconds&lt;/STRONG&gt; in a second]. Do note (as previously mentioned) that these will be static numbers only updated when refreshing the page.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 20:49:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Countdown-on-Landing-Page-Marketing-Starter/m-p/963978#M38730</guid>
      <dc:creator>DevenD</dc:creator>
      <dc:date>2024-04-20T20:49:44Z</dc:date>
    </item>
  </channel>
</rss>

