# API sometimes returns timestamp instead of date time string

**URL:** <https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [February 26, 2025, 10:44am UTC](https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888 "2025-02-26T10:44:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![attrib](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@attrib](https://community.hubspot.com/u/attrib)\
**Post date:** [February 26, 2025, 10:44am UTC](https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888/1 "2025-02-26T10:44:50Z")

</div>

For one of our customers using our marketplace integration, we noticed that the API behaves kind of strangly.

Normaly the API returns datetimes in the format “2025-02-26T09:30:57.465Z” and dates in the format “2025-02-26”.

For one date field the value returns is a timestamp in milliseconds 1740441600000.

Reported meta data for this field is type “date” and fieldType “calculation\_equation”. So it seems that the API doesn’t convert the timestamp for calculated date fields.

It works though for “datetime” fields which have the fieldType “calculation\_equation”.

We are using v3 API and in this case it was for Deals ([Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/reference/api/crm/objects/deals))

---

<div class="post-metadata">

**Author:** ![kennedyp](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kennedyp](https://community.hubspot.com/u/kennedyp)\
**Post date:** [February 26, 2025, 7:12pm UTC](https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888/2 "2025-02-26T19:12:17Z")

</div>

Hi @attrib! Thank you for this post. Date fields come in many formats depending on the property itself. Have you verified the property type and noticed any consistency with the response?

I want to invite some subject matter experts to see if they have any suggestions.

Hey @Anton, [@Mike\_Eastwood](https://community.hubspot.com/t5/user/viewprofilepage/user-id/9259), @Bortami have you experienced this behavior with date values returned in varying formats?

_Best,_

Kennedy

---

<div class="post-metadata">

**Author:** ![Mike\_Eastwood](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mike_eastwood/32/70075_2.png) [@Mike\_Eastwood](https://community.hubspot.com/u/Mike_Eastwood)\
**Post date:** [February 26, 2025, 9:41pm UTC](https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888/3 "2025-02-26T21:41:39Z")

</div>

Hi @attrib

In the [API Properties Doc](https://developers.hubspot.com/docs/guides/api/crm/properties#property-type-and-fieldtype-values) it says a `dateTime` can be returned as a Date Time (UTC) or a Unix Timestamp (which is always in milliseconds).

In one app I check “is integrer” to decide how to handle the returned property.

All part of the fun!

Mike

p.s. thank you for the mention @kennedyp

Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of [Webalite](https://www.webalite.com?utm_campaign=community-forum&utm_source=community&utm_content=signature) a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of **Portal-iQ** the world’s first automated [HubSpot Portal Audit](https://portal-iq.com?utm_campaign=community-forum&utm_source=community-forum&utm_content=signature) that helps you work smarter with HubSpot.

---

<div class="post-metadata">

**Author:** ![attrib](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@attrib](https://community.hubspot.com/u/attrib)\
**Post date:** [February 27, 2025, 2:46pm UTC](https://community.hubspot.com/t/api-sometimes-returns-timestamp-instead-of-date-time-string/126888/4 "2025-02-27T14:46:59Z")

</div>

Thanks for the reply and answer.

I just hoped that we either can identifiy fields doing it this way, using the meta data of the field. And not just guessing using is\_int.

Also it looked stranged because most fields return a DateTime, just that one field…
