<?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: Contact date field is always empty after posting to forms API (yes it's in unix time) in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/236536#M15432</link>
    <description>&lt;P&gt;Solved. It was because there was a time component in the expires date. Once I used just the date component it worked ok.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Apr 2018 18:30:56 GMT</pubDate>
    <dc:creator>ChrisK1</dc:creator>
    <dc:date>2018-04-03T18:30:56Z</dc:date>
    <item>
      <title>Contact date field is always empty after posting to forms API (yes it's in unix time)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/236535#M15431</link>
      <description>&lt;P&gt;I am trying to use the Forms API to create a contact in HubSpot after someone submits a form on my website. I have it working with the exception of my custom Trial Expires Date field. This is a date picker field I created on a contact records to store the date the trial expires.&lt;/P&gt;
&lt;P&gt;The date is always showing empty on the newly created HubSpot contact, &lt;STRONG&gt;however the email that is sent to me (by HubSpot upon a form submission) has the expires date set and displayed correctly&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Here is a small sample of the code I am using to set the date (the expiresDate variable is a UTC DateTime object):&lt;/P&gt;
&lt;P&gt;DateTime unixDate = new DateTime(1970, 1, 1, 0, 0, 0, expiresDate.Kind);&lt;BR /&gt;
long expiresTimestamp = (System.Convert.ToInt64((expiresDate - unixDate).TotalSeconds)) * 1000;&lt;BR /&gt;
dictFormValues.Add("trial_expires_date", expiresTimestamp.ToString());&lt;/P&gt;
&lt;P&gt;Here is a screenshot of the HubSpot email I receive after submission...the date is correct.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;A class="lightbox" href="https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/2/2da3309837045c09a778035fa29d026bdea0ed12.png" data-download-href="/legacyfs/online/uploads/default/2da3309837045c09a778035fa29d026bdea0ed12" title="HubSpotEmail.png" rel="nofollow noopener"&gt;&lt;IMG src="https://community.hubspot.com/legacyfs/online/uploads/default/optimized/2X/2/2da3309837045c09a778035fa29d026bdea0ed12_1_394x500.png" alt="HubSpotEmail" width="394" height="500" /&gt;&lt;DIV class="meta"&gt;
&lt;SPAN class="filename"&gt;HubSpotEmail.png&lt;/SPAN&gt;&lt;SPAN class="informations"&gt;496x628 18.4 KB&lt;/SPAN&gt;&lt;SPAN class="expand"&gt;&lt;/SPAN&gt;
&lt;/DIV&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:50:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/236535#M15431</guid>
      <dc:creator>ChrisK1</dc:creator>
      <dc:date>2018-04-03T15:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Contact date field is always empty after posting to forms API (yes it's in unix time)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/236536#M15432</link>
      <description>&lt;P&gt;Solved. It was because there was a time component in the expires date. Once I used just the date component it worked ok.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 18:30:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/236536#M15432</guid>
      <dc:creator>ChrisK1</dc:creator>
      <dc:date>2018-04-03T18:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Contact date field is always empty after posting to forms API (yes it's in unix time)</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/268891#M24252</link>
      <description>&lt;P&gt;Hi, our team is also having trouble passing a trial start and end date via a form.&amp;nbsp; Pretty much exactly what was described above - it shows in the form submission, but is not passing thru to the contact record, and they are receiving the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#993300"&gt;&lt;EM&gt;&lt;STRONG&gt;This value wasn’t passed to the contact record. ‘5/7/2019’ isn’t a valid timestamp.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They've tried both with and without timestamp.&amp;nbsp; Can you provide the format you used to solve this?&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 17:59:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Contact-date-field-is-always-empty-after-posting-to-forms-API/m-p/268891#M24252</guid>
      <dc:creator>slucas</dc:creator>
      <dc:date>2019-05-07T17:59:38Z</dc:date>
    </item>
  </channel>
</rss>

