<?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: Date Format For Setting Dates In Workflows in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/752177#M1267</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/475927"&gt;@ArdenM&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you include a screenshot of your workflow and the error message so the community can better assist with the next steps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Kristen&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 15:37:48 GMT</pubDate>
    <dc:creator>kvlschaefer</dc:creator>
    <dc:date>2023-02-06T15:37:48Z</dc:date>
    <item>
      <title>Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/751617#M1266</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Workflow" style="width: 387px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84787iF3671610CB5E4359/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Workflow" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Workflow&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Error" style="width: 817px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84788i0F7D2A2C2D0DB442/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Error" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Error&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Custom Code Action" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84789i02E27E794B9A5265/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Custom Code Action" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Custom Code Action&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CCA Test" style="width: 999px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/84790iAA7E6155D9C680DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="CCA Test" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;CCA Test&lt;/span&gt;&lt;/span&gt;Hey folks! I'm trying to use a Custom Code Action to generate a date 60 days from the date of workflow execution, and then copy that to a date picker property (using the copy value to property action). However, no matter what format I set the date as in the CCA, I get a "property value isn't valid" error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know for sure exactly what the format needs to be in copying a date from a CCA to a field &lt;EM&gt;without&lt;/EM&gt; using the API? I'm trying to minimize my API impact here if possible. I haven't yet found any hints to the correct one online, and there are almost an infinite number of possibilities here.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 22:20:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/751617#M1266</guid>
      <dc:creator>ArdenM</dc:creator>
      <dc:date>2023-02-06T22:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/752177#M1267</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/475927"&gt;@ArdenM&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you include a screenshot of your workflow and the error message so the community can better assist with the next steps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Kristen&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 15:37:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/752177#M1267</guid>
      <dc:creator>kvlschaefer</dc:creator>
      <dc:date>2023-02-06T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/752463#M1268</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/106905"&gt;@kvlschaefer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added screenshots of the workflow, error message, custom code action, and the current CCA output to the original post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The enrolment criteria has a record id for testing purposes, and the CCA lacks a hubspot client because it's not accessing the API at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking a look!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 22:22:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/752463#M1268</guid>
      <dc:creator>ArdenM</dc:creator>
      <dc:date>2023-02-06T22:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/756850#M1295</link>
      <description>&lt;P&gt;Hey folks - after some back and forth with support I was eventually able to solve this. There are two main ways to accomplish my own goal of "set a date X days into the future and copy it to a date picker field".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;1&lt;/H1&gt;&lt;P&gt;The first, building off the workflow above, is to output the code-generated date as a UNIX timestamp (using miliseconds specifically - UNIX standard is seconds, but HubSpot uses miliseconds). Easiest way to do this with JS is&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Math.floor(dateVariableName.getTime())&lt;/LI-CODE&gt;&lt;P&gt;Output that value as a number variable, then use the Format Data action to coerce it to a date by using "plus_time" and adding 0 days (or any other measurement of time). As HubSpot stores its dates as UNIX timestamps anyway, it will correctly read the date, and you can use the output as a date value for a date picker.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArdenM_0-1676489040996.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/85458i1309B4C4BACF8851/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArdenM_0-1676489040996.png" alt="ArdenM_0-1676489040996.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H1&gt;2&lt;/H1&gt;&lt;P&gt;If you don't care about using a Custom Code Action to generate the date in the first place (i.e. you only need a simple date add/minus like here) you can achieve the same outcome without Custom Code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set a date field to the date of step using the Set Property action, take that date field and Format data to or remove the number of days, and then push that to the final date field you're looking to set. This is by far the simpler method if you don't have complex calculations needed to generate your date.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArdenM_1-1676489344906.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/85459i5CFC6CBCDB2F87BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArdenM_1-1676489344906.png" alt="ArdenM_1-1676489344906.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 19:30:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/756850#M1295</guid>
      <dc:creator>ArdenM</dc:creator>
      <dc:date>2023-02-15T19:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/782648#M1418</link>
      <description>&lt;P&gt;Thanks for sharing the outcome&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/475927"&gt;@ArdenM&lt;/a&gt;&amp;nbsp;, I wasn't aware of what the format data action does/can do and it totally solved my use case (creating yesterday's date and tomorrow's date properties from a today's date property created using a time stamp).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 09:21:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/782648#M1418</guid>
      <dc:creator>MPenfold</dc:creator>
      <dc:date>2023-04-17T09:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format For Setting Dates In Workflows</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/994906#M2397</link>
      <description>&lt;P&gt;Unix timestamp that is output from the Custom Code must adhere to the type of the property you're willing to set. If it's Date type and not Datetime then a Unix timestamp containing hours will evaluate to invalid format, and should be converted to a date only timestamp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date.parse('2024-06-20T10:10:27.188Z') -&amp;gt;&amp;nbsp;1718878227188 -&amp;gt; INVALID&lt;/P&gt;&lt;P&gt;Date.parse('2024-06-20') -&amp;gt;&amp;nbsp;1718841600000 -&amp;gt; OK&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 10:14:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Date-Format-For-Setting-Dates-In-Workflows/m-p/994906#M2397</guid>
      <dc:creator>JGrandperret</dc:creator>
      <dc:date>2024-06-20T10:14:33Z</dc:date>
    </item>
  </channel>
</rss>

