API sometimes returns timestamp instead of date time string

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)

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, @Bortami have you experienced this behavior with date values returned in varying formats?

Best,

Kennedy

Hi @attrib

In the API Properties Doc 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 a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.

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…