<?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: Update Custom Date Picker in Deals through the API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229500#M8396</link>
    <description>&lt;P&gt;Error was converting time for Date Picker. Has to be put in UTC.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 16:50:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2018-11-13T16:50:38Z</dc:date>
    <item>
      <title>Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229499#M8395</link>
      <description>&lt;P&gt;My company has created a custom property under the deals section of Delivery Date (delivery_date) which is set to Date Picker. When I try to post to "Update a Deal" &lt;A href="https://api.hubapi.com/deals/v1/deal/%7BdealID%7D?hapikey=%7BapiKey%7D" rel="nofollow noopener"&gt;https://api.hubapi.com/deals/v1/deal/{dealID}?hapikey={apiKey}&lt;/A&gt;, I get a (400) bad request.&lt;/P&gt;
&lt;P&gt;I am converting my DateTime to Unix Milliseconds.&lt;/P&gt;
&lt;P&gt;My JSON string looks like this :&lt;BR /&gt;
{&lt;BR /&gt;
"properties": [&lt;BR /&gt;
{&lt;BR /&gt;
"name":"delivery_date",&lt;BR /&gt;
"value":1542085200000&lt;BR /&gt;
}&lt;BR /&gt;
]&lt;BR /&gt;
}&lt;/P&gt;
&lt;P&gt;Does something look wrong with this request? Or am I supposed to do something before I am allowed to update this field?&lt;/P&gt;
&lt;P&gt;The program I am writing is a quick C# windows form to upload an excel file and read the values to a model, convert to JSON, and update the selected Deals by DealID. I am testing various fields before I move everything to a single request. So far, I can't figure out why this field won't accept the Unix Milliseconds.&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;KO&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 15:22:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229499#M8395</guid>
      <dc:creator />
      <dc:date>2018-11-13T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229500#M8396</link>
      <description>&lt;P&gt;Error was converting time for Date Picker. Has to be put in UTC.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:50:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229500#M8396</guid>
      <dc:creator />
      <dc:date>2018-11-13T16:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229501#M8397</link>
      <description>&lt;P&gt;Welcome, &lt;A class="mention" href="https://community.hubspot.com/u/kobrien"&gt;@kobrien&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I'm glad you were able to find a solution so quickly!&lt;/P&gt;
&lt;P&gt;For others viewing this topic, check out the &lt;A href="https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis"&gt;How should timestamps be formatted for HubSpot's APIs?&lt;/A&gt; article for additional information.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 20:18:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229501#M8397</guid>
      <dc:creator>IsaacTakushi</dc:creator>
      <dc:date>2018-11-14T20:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/274983#M25018</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was struggling on this as well. Thanks for your post.&lt;/P&gt;&lt;P&gt;For those who wanna test that your timestamp is based on midnigth UTC you can check it through this website: &lt;A href="https://www.epochconverter.com/" target="_blank"&gt;https://www.epochconverter.com/&lt;/A&gt;&lt;BR /&gt;For those using momentjs:&lt;BR /&gt;``moment.utc(&lt;EM&gt;your_date&lt;/EM&gt;, 'YYYY-MM-DD').valueOf()``&lt;BR /&gt;Make sure to replace 'YYYY-MM-DD' with your date format.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 12:07:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/274983#M25018</guid>
      <dc:creator>MathieuH</dc:creator>
      <dc:date>2019-06-13T12:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/275659#M25091</link>
      <description>&lt;P&gt;The datepicker field wants a Unix timestamp with microseconds, but it must be the exact value of midnight in UTC. It will choke on your localized time zone. Here is how I set the value in PHP:&lt;/P&gt;&lt;PRE&gt;$target_date = date( 'Y-m-d', strtotime( 'tomorrow' ) );&lt;BR /&gt;$timezone_object = new \DateTimeZone( 'UTC' );
$date_object = new \DateTime( $target_date, $timezone_object );
$datepicker_value = $date_object-&amp;gt;format( 'U' ) * 1000;&lt;/PRE&gt;&lt;P&gt;PHP's DateTime object will output a Unix timestamp in seconds, so you have to multiply by 1000 to convert the value to include microseconds.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 23:23:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/275659#M25091</guid>
      <dc:creator>danhammari</dc:creator>
      <dc:date>2019-06-17T23:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Update Custom Date Picker in Deals through the API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/1059546#M77626</link>
      <description>&lt;P&gt;In input, from C#, has to be that you convert it to a LONG. Specifically, a UNIX TIME milliseconds WITHOUT timezone offset.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static long ToUnixTimeMilliseconds(this DateTime dateTime)
{
   var dateMidnight = DateTime.ParseExact(dateTime.ToString("yyyyMMdd"), "yyyyMMdd", CultureInfo.InvariantCulture);
   var offset = new DateTimeOffset(dateMidnight.Date, TimeSpan.Zero); // Removed UTC offset
   return offset.ToUnixTimeMilliseconds();
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Oct 2024 01:13:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/1059546#M77626</guid>
      <dc:creator>tkoseoglu</dc:creator>
      <dc:date>2024-10-24T01:13:55Z</dc:date>
    </item>
  </channel>
</rss>

