Best practice for setting deal close dates via API?

When setting deal close dates via the API, we are sending a UTC midnight timestamp. However, Hubspot displays this close date in our local timezone in our portal. Since we are -7 hours from UTC here on the US west coast, all deals appear as if they closed a day earlier than they actually did (i.e. midnight UTC becomes 5pm the previous day PST). How can we get the best of both worlds here, sending Hubspot the format it needs, while displaying things correctly on the front-end and in reporting?

Hi @cc2,

Close Date is a datetime property, so you can send a complete unix timestamp and the HubSpot UI will display the full date & time. Only date properties need to be set to UTC midnight; check out the following developer doc for more details:

developers.hubspot.com

How should timestamps be formatted for HubSpot’s APIs?

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…

Thanks! Thought it was just a date field.

It does accept timestamp, though it has to be timestamp in midnight in utc.