<?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: Valid formats for date fields when posting via HubSpot API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229974#M8870</link>
    <description>&lt;P&gt;Thanks for the quick response and helpful link, &lt;A class="mention" href="https://community.hubspot.com/u/dadams"&gt;@dadams&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2016 02:17:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-12T02:17:29Z</dc:date>
    <item>
      <title>Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229972#M8868</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;I’m trying to figure out a (or the) correct format for sending date parameters via a POST request to a form with a date picker via the &lt;CODE&gt;/uploads/form/v2/:portal_id/:form_guid&lt;/CODE&gt; endpoint.&lt;/P&gt;
&lt;P&gt;I first tried &lt;CODE&gt;yyyy-mm-dd&lt;/CODE&gt; format, e.g., for August 15, 2016 I sent &lt;CODE&gt;2016-08-15&lt;/CODE&gt;. Although this seems to be interpreted correctly when you view submissions for that particular form, when looking at the associated Contact that it creates or updates, the date field displays &lt;CODE&gt;Invalid date&lt;/CODE&gt; in red.&lt;/P&gt;
&lt;P&gt;On the other hand, sending the date in &lt;CODE&gt;mmm dd yyyy&lt;/CODE&gt;, e.g. &lt;CODE&gt;Aug 15 2016&lt;/CODE&gt;, displays the date as &lt;CODE&gt;Invalid date&lt;/CODE&gt; when viewing submissions to the form, but when drilling down to a specific Contact, the date displays correctly.&lt;/P&gt;
&lt;P&gt;Assuming I’d prefer the latter — that this date get written to the Contact’s record correctly — is &lt;CODE&gt;mmm dd yyyy&lt;/CODE&gt; the format of choice to send via this endpoint? Is there a standard format for sending date parameters to the HubSpot API that would be correctly interpreted in both cases? Can I decouple the way dates are displayed in HubSpot and how I choose to send them via the API by some admin setting?&lt;/P&gt;
&lt;P&gt;Thanks for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 15:51:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229972#M8868</guid>
      <dc:creator />
      <dc:date>2016-08-11T15:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229973#M8869</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/o-i"&gt;@O-I&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Date properties need to be set as UNIX formatted timestamps, in milliseconds. As an example, you would use 1430438400000 as the value for the time 01 May 2015 00:00:00 UTC.  This goes for form submissions as well as updates made through the Contacts API.&lt;/P&gt;
&lt;P&gt;More details can be found here:&lt;BR /&gt;
&lt;ASIDE class="onebox whitelistedgeneric"&gt;
  &lt;HEADER class="source"&gt;
      &lt;IMG src="https://developers.hubspot.com/hs-fs/hub/428357/file-2168997910-ico/favicon.ico?t=1511211924848" class="site-icon" width="16" height="16" /&gt;
      &lt;A href="https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis" target="_blank" rel="nofollow noopener"&gt;developers.hubspot.com&lt;/A&gt;
  &lt;/HEADER&gt;
  &lt;ARTICLE class="onebox-body"&gt;
    

&lt;/ARTICLE&gt;&lt;/ASIDE&gt;&lt;/P&gt;&lt;H3&gt;&lt;A href="https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis" target="_blank" rel="nofollow noopener"&gt;How should timestamps be formatted for HubSpot's APIs?&lt;/A&gt;&lt;/H3&gt;

&lt;P&gt;HubSpot API endpoints accept UNIX formatted timestamps in milliseconds. Most scripting languages have built-in functions or existing libraries that handle time conversion, but you must ensure that your timestamp values are in the correct UNIX...&lt;/P&gt;


  
  &lt;DIV class="onebox-metadata"&gt;
    
    
  &lt;/DIV&gt;
  &lt;DIV style="clear: both"&gt;&lt;/DIV&gt;

&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 22:13:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229973#M8869</guid>
      <dc:creator>Dadams</dc:creator>
      <dc:date>2016-08-11T22:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229974#M8870</link>
      <description>&lt;P&gt;Thanks for the quick response and helpful link, &lt;A class="mention" href="https://community.hubspot.com/u/dadams"&gt;@dadams&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 02:17:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229974#M8870</guid>
      <dc:creator />
      <dc:date>2016-08-12T02:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229975#M8871</link>
      <description>&lt;P&gt;If anyone stumbles upon this thread and is looking for a solution using Ruby/Rails, here’s how I had to do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;def hubspot_formatted_date(date)
  return nil if date.nil?

  Time.utc(date.year, date.month, date.day).strftime('%s%3N')
end
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That last strftime puts it in 13-digit format.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 20:48:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229975#M8871</guid>
      <dc:creator>gregblass</dc:creator>
      <dc:date>2018-01-05T20:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229976#M8872</link>
      <description>&lt;P&gt;I am having some trouble submitting post requests to create a deal because the timestamp value for a date picker property is not being accepted by the hubspot api. Here is the timestamp value 1206331200000. The date is 3/24/2008. The API accepts the value of 1430438400000 that you list above but not my value. I have run my value through some online converters and it shows as being valid. Why is the Hubspot API returning bad request when this value is included in the request.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 14:17:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229976#M8872</guid>
      <dc:creator>agjoligu</dc:creator>
      <dc:date>2018-05-04T14:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Valid formats for date fields when posting via HubSpot API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229977#M8873</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/inproductiondev"&gt;@InProductionDev&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;That timestamp value is midnight 3/24/2008 ET, not midnight UTC. UTC midnight 3/24/2008 would be &lt;CODE&gt;1206316800000&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 14:55:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Valid-formats-for-date-fields-when-posting-via-HubSpot-API/m-p/229977#M8873</guid>
      <dc:creator>Derek_Gervais</dc:creator>
      <dc:date>2018-05-08T14:55:32Z</dc:date>
    </item>
  </channel>
</rss>

