I’m just starting to use the API to create new contacts. However, I’m having trouble adding a date property (a date-of-birth, in this case) to my contact.
I understand that the API requires dates to be passed as UNIX timestamps with a time of midnight UTC. I believe that I am passing a valid timestamp, but am getting this error:
1358640000 is at 17:24:0.0 UTC, not midnight!
According to the UNIX timestamp converter at https://www.unixtimestamp.com, my timestamp of 1358640000 does indeed equate to 01/20/2013 @ 12:00am (UTC). Any thoughts as to what the issue may be?
Hi @brijazz
It appears as though this timestamp is in seconds and not milliseconds as is required by our APIs.
If I go ahead and convert this, we get the following value in milliseconds:
1358640000000
You can find more detail on how timestamps should be formatted here in our resources:
I hope this helps!
Ah, milliseconds! Got it, problem solved.
Even though HubSpot suggests https://www.unixtimestamp.com for verifying Unix Epoch Date values it does not process values in Milliseconds as their API’s require. I’d suggest instead https://www.epochconverter.com/ as it will detect whether or not you are providing Epoch Date vlaues in Milliseconds or not.