APIs & Integrations

aanchal
Participant

date-time data type not available for timeline event type property

While creating a property for a timeline event type, the data type options were: Date, Enumeration, Numeric and String. But what we require is a Date-time data type. Is there a way to set this data type for a property?

 

Looking into this article: https://developers.hubspot.com/docs/methods/contacts/v2/create_contacts_property

it seems that we can create custom properties of datetime data type only for contact/company/deal/ticket objects using the hubspot API but not for the Timeline event type. The following doc clearly list of valid property types(Date, Enumeration, Numeric, or String) for the custom property in the timeline event type: https://developers.hubspot.com/docs/methods/timeline/create-timeline-event-type-property 

 

EDIT: After testing I found that surprisingly when I created a timeline event specifying value(1569925412000) to a property of data type 'date', the created event has the value: Oct 1, 2019 6:23:32 AM. I had expected to either get an error stating the timestamp needed to correspond to midnight UTC time or the value: Oct 1, 2019.

Also, I'd also created a custom property of property type 'datetime' and fieldtype 'date', in the Contact Object. When I updated a contact by specifying the value (1569925412000) to that property and fetched the contact info using API, I got the same value but when I viewed the value from the Hubspot UI, only the date was displayed (10/01/2019). I even try using different field type i.e. 'text' and 'number' but none worked.

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

date-time data type not available for timeline event type property

Hi @aanchal,

 

I hope all is well with you 😄

 

Can I clarify that the end goal here is to have the date time showing on a contact property? If that's the end goal, this is currently not possible. While the UI of the contact record will display only the date format, when retrieving the contact information via endpoint such as Get contact by email, you will be able to see the date and time.

 

The reason why you're seeing the date time when specifying the value - 1569925412000 on a date data type property of the timeline event is because you formatted the date property as such:

{{#formatDate AppliedDate}}{{/formatDate}}

If the AppliedDate is being pulled without the format, it'll show this 1569925412000 instead.

 

I hope this helps to further clarify things!

0 Upvotes