# Error sending Date Picker value through API

**URL:** <https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [December 1, 2020, 7:02pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626 "2020-12-01T19:02:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakeW](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jakew/32/7115_2.png) [@JakeW](https://community.hubspot.com/u/JakeW)\
**Post date:** [December 1, 2020, 7:02pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/1 "2020-12-01T19:02:05Z")

</div>

We are sending a date value to a date picker property in the form of YYYY-MM-DD (which we’ve confirmed with the app is ISO8601 compliant, but maybe that’s intrinsic of the date when written that way - don’t know what I’m talking about)

we are getting this error:

“validationResults”: [  
{  
“isValid”: false,  
“message”: “2020-12-01 was not a valid long. Portal xxxxxxx, object type 0-3”,  
“error”: “INVALID\_LONG”,  
“name”: “invoice\_sent”  
}  
],  
“status”: “error”,  
“message”: “Property values were not valid”,

The Hubspot [documentation](https://developers.hubspot.com/docs/api/faq) says this:

Examples:

- 2015-05-01 would be used for May 1 2015

Not really a developer - any tips you can help me with?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 1, 2020, 10:37pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/2 "2020-12-01T22:37:22Z")

</div>

Hey @JakeW

You will want the date in the unix timestamp format as detailed [here](https://legacydocs.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis) 😀

You are working your way up the ladder as a developer 😉

---

<div class="post-metadata">

**Author:** ![JakeW](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jakew/32/7115_2.png) [@JakeW](https://community.hubspot.com/u/JakeW)\
**Post date:** [December 1, 2020, 10:45pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/3 "2020-12-01T22:45:16Z")

</div>

Thanks @dennisedson - am I misreading the FAQ in this case then? One example given is in Unix as you’ve suggested, but it also lists a stock YYYY-MM-DD as an ‘example’ of how to send dates to a Date Picker property.  
Here’s a screenshot from [this article](https://developers.hubspot.com/docs/api/faq) I’m referring to

 ![34892iE9435643A6F9BDE6.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/7/07b0d4f42661bb0fbb0dfd7f8c62c4a05957952f.png)

I’m only going the extra mile to ask here because our app doesn’t have an automatic means to reformat dates into a Unix timestamp

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 2, 2020, 6:01pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/4 "2020-12-02T18:01:24Z")

</div>

Hey @JakeW ,

Thanks for following up on that. Looks like we may have some contradictory messaging 🤔

Would you do me a favor and send me the endpoint that you are posting to (minus hapikey) as well as the json body?

Here is a [post](https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229501/highlight/true#M8397) with a similar issue as well as the [referenced docs](https://legacydocs.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis)

Once you send me the details I asked for, I will test and make sure we get some consistency 😀

---

<div class="post-metadata">

**Author:** ![JakeW](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jakew/32/7115_2.png) [@JakeW](https://community.hubspot.com/u/JakeW)\
**Post date:** [December 3, 2020, 4:49pm UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/5 "2020-12-03T16:49:29Z")

</div>

Thanks @dennisedson - the docs mention UNIX timestamp - I think we can do that through the app we’re trying to do this with. I don’t know how to determine what endpoint we are posting to, or what a hapikey and json body are, so I’m not sure I can help further o\_o  
For now I’ll just assume that we need to send it in UNIX in milliseconds, and it’s incorrect to say that date pickers can receive a straight up YYYY-MM-DD value …

---

<div class="post-metadata">

**Author:** ![AKhanduri](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@AKhanduri](https://community.hubspot.com/u/AKhanduri)\
**Post date:** [September 27, 2022, 4:32am UTC](https://community.hubspot.com/t/error-sending-date-picker-value-through-api/28626/6 "2022-09-27T04:32:56Z")

</div>

I am running into the same issue with using unix timestamp as well and have asked this question multiple times via support but no answer.
