<?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: HubDB and BST dates in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23087#M2225</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/6158"&gt;@telega&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your date and time localized? Check out the &lt;A href="http://designers.hubspot.com/docs/hubl/hubl-supported-variables" target="_self"&gt;HubL variables&lt;/A&gt;, there are a lot of different options for date and time, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="td"&gt;{{ content.publish_date_localized }}&lt;/DIV&gt;&lt;DIV class="td"&gt;string&lt;/DIV&gt;&lt;DIV class="td"&gt;&lt;SPAN&gt;A string representing the&amp;nbsp;datetime&amp;nbsp;when the content was published, in the local time as defined in the HubSpot Report settings. This variable is also subject to the language&amp;nbsp;and &amp;nbsp;dateformat settings in&amp;nbsp;&lt;STRONG&gt;Content Settings &amp;gt; Blog&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 19 Jul 2017 16:13:20 GMT</pubDate>
    <dc:creator>Jsum</dc:creator>
    <dc:date>2017-07-19T16:13:20Z</dc:date>
    <item>
      <title>HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23050#M2224</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have created a table in hubDB to track press releases, and a listing page to display them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The listing page filters by comparing the date in the table item (item.date|unixtimestamp) to the local time (local_dt|unixtimestamp). As far as I can tell, the local_dt is adjusting for BST, but the item.date from HubDB is not. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is this correct, and does anyone know of work around ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:16:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23050#M2224</guid>
      <dc:creator>telega</dc:creator>
      <dc:date>2017-07-19T13:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23087#M2225</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/6158"&gt;@telega&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your date and time localized? Check out the &lt;A href="http://designers.hubspot.com/docs/hubl/hubl-supported-variables" target="_self"&gt;HubL variables&lt;/A&gt;, there are a lot of different options for date and time, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="td"&gt;{{ content.publish_date_localized }}&lt;/DIV&gt;&lt;DIV class="td"&gt;string&lt;/DIV&gt;&lt;DIV class="td"&gt;&lt;SPAN&gt;A string representing the&amp;nbsp;datetime&amp;nbsp;when the content was published, in the local time as defined in the HubSpot Report settings. This variable is also subject to the language&amp;nbsp;and &amp;nbsp;dateformat settings in&amp;nbsp;&lt;STRONG&gt;Content Settings &amp;gt; Blog&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:13:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23087#M2225</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2017-07-19T16:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23091#M2226</link>
      <description>&lt;P&gt;Yeah, its not a HubL variable though, its a field in a HubDB table.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 16:23:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/23091#M2226</guid>
      <dc:creator>telega</dc:creator>
      <dc:date>2017-07-19T16:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24506#M2352</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;{{ row["your_date_column_name"]|datetimeformat('%A %e %B %Y') }}&lt;/P&gt;&lt;P&gt;and the date will be for example&lt;/P&gt;&lt;P&gt;sunday 2 september 2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Giovanni Zuanon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2017 07:35:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24506#M2352</guid>
      <dc:creator>giozua</dc:creator>
      <dc:date>2017-07-29T07:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24583#M2359</link>
      <description>&lt;P&gt;I have a feeling im not explaining the problem clearly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem isnt with the display formatting, its with the underlying date value.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 12:06:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24583#M2359</guid>
      <dc:creator>telega</dc:creator>
      <dc:date>2017-07-31T12:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24602#M2362</link>
      <description>&lt;P&gt;Sorry but I don't understand.&lt;/P&gt;&lt;P&gt;If you want compare two dates you can have a string like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{% if (row['your_date_column_name]|datetimeformat('%j')) &amp;gt;= (local_dt|datetimeformat('%j')) &amp;nbsp;%}&lt;/P&gt;&lt;P&gt;(this means that your date is more recent then today date) .... write your conditions&lt;/P&gt;&lt;P&gt;{% else&amp;nbsp;% }&lt;/P&gt;&lt;P&gt;...alternative conditions...&lt;/P&gt;&lt;P&gt;{% endif %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that I have in my hibdb a column of date_event with date format (not datetime) so I've transform my date in timestamp with %j format&lt;/P&gt;&lt;P&gt;I hope this can help you&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Giovanni Zuanon&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 13:46:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24602#M2362</guid>
      <dc:creator>giozua</dc:creator>
      <dc:date>2017-07-31T13:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24630#M2366</link>
      <description>&lt;P&gt;You are correct, thank you. I did:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{%if release['date']|datetimeformat('%Y %m %d %H') &amp;lt;= local_dt|datetimeformat('%Y %m %d %H')%}&lt;/PRE&gt;&lt;P&gt;After some digging I think my issue is that the |unixtimestamp filter is not doing what I expected it to do. I should adjust the timezone of the local_dt before filtering it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 15:18:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/24630#M2366</guid>
      <dc:creator>telega</dc:creator>
      <dc:date>2017-07-31T15:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/276390#M12698</link>
      <description>&lt;P&gt;We recently were working through a similar issue where datetimes set in hubdb were being set in the content administrators time (CDT/CST), and we needed a way to shift those times into the correct local timezone, &lt;EM&gt;as though they were set in the correct timezone to begin with&lt;/EM&gt;. We settled on parsing out the timezone offset from the local_dt (which changes during the course of the year), and then using that in computing the datetimes for display purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see how that works with the code below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"my_time" should be the timestamp you get from hubdb. &lt;BR /&gt;In order for this code to run, I'm just using the local_dt.&lt;BR /&gt;{% set my_time = unixtimestamp(local_dt) %}&lt;BR /&gt;&lt;BR /&gt;Get the offset value for the local dt:
{% set offset = datetimeformat(local_dt, '%z') %}&lt;BR /&gt;&lt;BR /&gt;Convert the offset value for the local dt a numerical representation of "hours to be added to a unix timestamp", eg 5.0
{% set offset_num = (((offset|float) / 100) * -1) %}&lt;BR /&gt;&lt;BR /&gt;Convert those hours into milliseconds and back into integer to avoid floating point errors.
{% set offset_millis = (offset_num * 60 * 60 * 1000)|int %}
&lt;BR /&gt;Values for debugging:
{{my_time}}
{{offset}}
{{offset_num}}
{{offset_millis}}
&lt;BR /&gt;Final shifted value (in milliseconds):
{{my_time+offset_millis}}&lt;/PRE&gt;&lt;P&gt;Hopefully someone will find that useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 18:32:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/276390#M12698</guid>
      <dc:creator>keegan-sbm</dc:creator>
      <dc:date>2019-06-20T18:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: HubDB and BST dates</title>
      <link>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/285070#M13212</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/63264"&gt;@keegan-sbm&lt;/a&gt;This should definintely me marked as a solution. It's the only route we could use to solve this time issue. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 14:42:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/HubDB-and-BST-dates/m-p/285070#M13212</guid>
      <dc:creator>Guru</dc:creator>
      <dc:date>2019-08-08T14:42:03Z</dc:date>
    </item>
  </channel>
</rss>

