# Date Picker input vs output

**URL:** <https://community.hubspot.com/t/date-picker-input-vs-output/119052>\
**Category:** APIs & Integrations\
**Created:** [October 24, 2024, 1:04am UTC](https://community.hubspot.com/t/date-picker-input-vs-output/119052 "2024-10-24T01:04:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkoseoglu](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tkoseoglu/32/204239_2.png) [@tkoseoglu](https://community.hubspot.com/u/tkoseoglu)\
**Post date:** [October 24, 2024, 1:04am UTC](https://community.hubspot.com/t/date-picker-input-vs-output/119052/1 "2024-10-24T01:04:19Z")

</div>

I am posting to an HS entity which has, among other data types, a property of type Date Picker.

As per your documentation, it expects a UNIX formatted LONG. The POST works and all is good until I get the response body back. Now, the exact same property that expected a LONG as input, spits out a string in the format of “2024-10-01”. So, the input is 17434343000 and the output is “2024-10-01”?

How are we supposed to parse that into the same property that has a type of LONG? Why doesn’t the API spit out a LONG, just like expected it as the input?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 24, 2024, 8:04pm UTC](https://community.hubspot.com/t/date-picker-input-vs-output/119052/2 "2024-10-24T20:04:28Z")

</div>

Hey, @tkoseoglu 👋 Thanks for your post. It’s a valid comment.

HubSpot doesn’t publish the underlying “why” in its documentation. I can confirm the endpoint is working as intended, even if it’s not returning a response in the format you are expecting. You’ll need to convert the ISO string back to UNIX timestamp if you are using the response in additional requests. I agree, this adds an extra layer of complexity to your process.

For other users who may come across this post, here is a quick example of one way to covert this back to UNIX format using JS

```lia-code-sample
const dateStr = "2024-10-01";
const date = new Date(dateStr);
const unixTimestamp = date.getTime();
console.log(unixTimestamp);

```

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [November 14, 2024, 6:48am UTC](https://community.hubspot.com/t/date-picker-input-vs-output/119052/3 "2024-11-14T06:48:06Z")

</div>

Hi @tkoseoglu

you need to convert the date into a timestamp here. In JS it should look something like this

new Date\*\*(“2024-10-01”).valueOf();\*\*

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!
