APIs & Integrations

brodi
Participant

Having close date issue with deals

SOLVE

We are adding deals through api with deal stage 'Closed Won', sending 'closedate' as '1510704000' timestamp which is  November 15, 2017, but for all deals close date is'Jan 18, 1970',  in the HubSpot portal. How should I send it?

0 Upvotes
1 Accepted solution
Willson
Solution
HubSpot Employee
HubSpot Employee

Having close date issue with deals

SOLVE

Hi @brodi 

 

In order for this to update correctly, you need to ensure the timestamp is converted to milliseconds and not seconds as this value is currently passed in. 


As it stands, in seconds, we see the following conversion:

Seconds:
1510704000

Timestamp conversion:
January 18th, 1970 12:38 PM

If we change this to milliseconds, we get the following:

Milliseconds:
1510704000000

Timestamp conversion:
November 15th, 2017 12:00 AM

This is outlined in our documentation here: https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis


I hope this helps!

Product Manager @ HubSpot

View solution in original post

0 Upvotes
1 Reply 1
Willson
Solution
HubSpot Employee
HubSpot Employee

Having close date issue with deals

SOLVE

Hi @brodi 

 

In order for this to update correctly, you need to ensure the timestamp is converted to milliseconds and not seconds as this value is currently passed in. 


As it stands, in seconds, we see the following conversion:

Seconds:
1510704000

Timestamp conversion:
January 18th, 1970 12:38 PM

If we change this to milliseconds, we get the following:

Milliseconds:
1510704000000

Timestamp conversion:
November 15th, 2017 12:00 AM

This is outlined in our documentation here: https://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis


I hope this helps!

Product Manager @ HubSpot
0 Upvotes