# Returned field format different for webhook and API

**URL:** <https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [April 8, 2024, 2:51pm UTC](https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349 "2024-04-08T14:51:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASpyropoulos](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@ASpyropoulos](https://community.hubspot.com/u/ASpyropoulos)\
**Post date:** [April 8, 2024, 2:51pm UTC](https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349/1 "2024-04-08T14:51:32Z")

</div>

Hi all,  
in line\_items object  
hs\_recurring\_billing\_start\_date field is returned in API as “2024-04-27” while with webhook as “1714176000000”.  
Can we fix this to be returned with the same format from both API and webhook?  
Thanks

---

<div class="post-metadata">

**Author:** ![DianaGomez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dianagomez/32/48035_2.png) [@DianaGomez](https://community.hubspot.com/u/DianaGomez)\
**Post date:** [April 9, 2024, 11:43am UTC](https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349/2 "2024-04-09T11:43:59Z")

</div>

Hi @ASpyropoulos,

Thanks for reaching out to the Community!

I was researching this topic and came across a solution from @karstenkoehler to a similar question in the Community: [Workflow “Send a Webhook” is sending wrong data](https://community.hubspot.com/t5/Lists-Lead-Scoring-Workflows/Workflow-quot-Send-a-Webhook-quot-is-sending-wrong-data/td-p/890086).

Could you take a look to see if this helps with answering your question?

Thanks!

Diana

---

<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:** [April 9, 2024, 3:13pm UTC](https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349/3 "2024-04-09T15:13:37Z")

</div>

Hi @ASpyropoulos

You have to format the date because the webhook returns the date in timestamp format:  
For example, if you are using NodeJs then you have to use the following statements for date formatting:

```lia-code-sample
let date=new Date(1714176000000);
let formatDate=date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + (date.getDate())).slice(-2);

```

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

---

<div class="post-metadata">

**Author:** ![dsmarion](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dsmarion/32/7509_2.png) [@dsmarion](https://community.hubspot.com/u/dsmarion)\
**Post date:** [April 10, 2024, 12:54pm UTC](https://community.hubspot.com/t/returned-field-format-different-for-webhook-and-api/104349/4 "2024-04-10T12:54:03Z")

</div>

If you’re using Node and you have the Luxon package you can use something like:

```lia-code-sample
// Import the DateTime object from Luxon
const { DateTime } = require('luxon');

// Create a timestamp in milliseconds
const timestamp = 1654848000000;

// Create a DateTime object from the timestamp
const date = DateTime.fromMillis(timestamp);

```

[https://www.npmjs.com/package/luxon](https://www.npmjs.com/package/luxon)
