<?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 Copying custom date values to date property error in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981063#M73834</link>
    <description>&lt;P&gt;Interesting one today!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a workflow with a custom code element which retrives the hs_timestamp value (in the format '&lt;SPAN&gt;2024-01-10T16:00:00Z'), and that all works fine.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Up until about April, I was able to successfully copy this datetime output to a date property within the workflow. However! it then started generating the error for seemingly no reason:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"Unable to update property because property value isn't valid"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried converting the timestamp value into a unix value, but no cigar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any idea as to what caused this change, and if there are any solutions/alternatives?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance crew &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 09:50:17 GMT</pubDate>
    <dc:creator>EddBrisley</dc:creator>
    <dc:date>2024-05-23T09:50:17Z</dc:date>
    <item>
      <title>Copying custom date values to date property error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981063#M73834</link>
      <description>&lt;P&gt;Interesting one today!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a workflow with a custom code element which retrives the hs_timestamp value (in the format '&lt;SPAN&gt;2024-01-10T16:00:00Z'), and that all works fine.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Up until about April, I was able to successfully copy this datetime output to a date property within the workflow. However! it then started generating the error for seemingly no reason:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"Unable to update property because property value isn't valid"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried converting the timestamp value into a unix value, but no cigar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any idea as to what caused this change, and if there are any solutions/alternatives?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance crew &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 09:50:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981063#M73834</guid>
      <dc:creator>EddBrisley</dc:creator>
      <dc:date>2024-05-23T09:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Copying custom date values to date property error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981314#M73849</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/726665"&gt;@EddBrisley&lt;/a&gt;&amp;nbsp;- I don't know how picky the format conversions are, but I ended up using date stamp values formatted as&amp;nbsp;"%Y-%m-%dT%H:%M:00.000Z" - looks like there is an extra decimal place usage vs your reported format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have any insight into what may have changed recently with date handling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 16:02:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981314#M73849</guid>
      <dc:creator>SteveHTM</dc:creator>
      <dc:date>2024-05-23T16:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Copying custom date values to date property error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981670#M73872</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/63499"&gt;@SteveHTM&lt;/a&gt;&amp;nbsp;, thanks for your response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just tested with the extra decimal place, and that doesn't seem to be it. Thanks anyway, I'll keep digging, if I find out what's up I'll post here&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 09:52:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/981670#M73872</guid>
      <dc:creator>EddBrisley</dc:creator>
      <dc:date>2024-05-24T09:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copying custom date values to date property error</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/983807#M74014</link>
      <description>&lt;P&gt;I actually built a workflow the other day and ran into this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Couple of things I noted:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When copying the date or date/time properties that you've fetched via an API call you must convert to a date object and then getTime() for the millisecond timestamp&lt;/LI&gt;&lt;LI&gt;If you're copying this value to a date property (not a date time property) you have to set the hours, minutes, seconds and milliseconds to 0. It will only accept round dates, even if in millisecond timestamps.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Below is a code sample of how I went about this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timestamp = apiResponse.results[0]["properties"]["hs_timestamp"];
const dateObject = new Date(timestamp);
dateObject.setUTCHours(0, 0, 0, 0);
timestamp = dateObject.getTime();&lt;/LI-CODE&gt;&lt;P&gt;I was specifically using the results from an API call, so need to convert it to a date object first to be able to manipulate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 12:58:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Copying-custom-date-values-to-date-property-error/m-p/983807#M74014</guid>
      <dc:creator>KimM</dc:creator>
      <dc:date>2024-05-29T12:58:10Z</dc:date>
    </item>
  </channel>
</rss>

