# Date being rejected by API

**URL:** <https://community.hubspot.com/t/date-being-rejected-by-api/18391>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [January 28, 2020, 1:14pm UTC](https://community.hubspot.com/t/date-being-rejected-by-api/18391 "2020-01-28T13:14:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brijazz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brijazz/32/1529_2.png) [@brijazz](https://community.hubspot.com/u/brijazz)\
**Post date:** [January 28, 2020, 1:14pm UTC](https://community.hubspot.com/t/date-being-rejected-by-api/18391/1 "2020-01-28T13:14:24Z")

</div>

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](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?

 ![Timestamp Converter.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/c/a/ca1627c4fc668cb47729943f938ab41cee304948.png)

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [January 28, 2020, 1:33pm UTC](https://community.hubspot.com/t/date-being-rejected-by-api/18391/2 "2020-01-28T13:33:45Z")

</div>

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:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Ffaq%2Fhow-should-timestamps-be-formatted-for-hubspots-apis)**

I hope this helps!

---

<div class="post-metadata">

**Author:** ![brijazz](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brijazz/32/1529_2.png) [@brijazz](https://community.hubspot.com/u/brijazz)\
**Post date:** [January 28, 2020, 4:11pm UTC](https://community.hubspot.com/t/date-being-rejected-by-api/18391/3 "2020-01-28T16:11:17Z")

</div>

Ah, **milli** seconds! Got it, problem solved.

---

<div class="post-metadata">

**Author:** ![nadendav](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/nadendav/32/52876_2.png) [@nadendav](https://community.hubspot.com/u/nadendav)\
**Post date:** [March 18, 2020, 6:53pm UTC](https://community.hubspot.com/t/date-being-rejected-by-api/18391/4 "2020-03-18T18:53:41Z")

</div>

Even though HubSpot suggests [https://www.unixtimestamp.com](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/](https://www.epochconverter.com/) as it will detect whether or not you are providing Epoch Date vlaues in Milliseconds or not.
