Convert a UNIXTIMESTAMP into a human readable Date + Time

We would like to push a meeting time to HubSpot via the Demodesk integration. Unfortunately, we can only get it as a UNIXTIMESTAMP in a single-line text. We want to convert this into a human readable property using custom code. According to the test run, it should work. However, when we send a contact through the workflow, the UNIXTIMESTAMP still remains. Can anyone help us here? Thanks in advance.

Hi Jonas,

Have you checked your workflow action logs for this custom code? You mean the output cx___demodesk__meetinglink is still the timestamp not local time string?
Cereno

Hey Cereno,
thanks a lot for your help. In the message before, there was a mistake in the property. It should be “cx___demodesk__meetinglink”. Either way, it still doesn’t work. The workflow claims that it works, but nothing is visible in the contact.
Jonas

Hi Jonas,

Your custom code, and the input/output for it are correct. The issue should be from the workflow. The workflow is something like below?

  1. Entrollment trigger while meeting time is known
  2. That custom code
  3. The “cx___demodesk__meetinglink” value is inserted into the contact’s property

It’s possible you share the scrrenshot for the workflow?

Cereno

Hey Cereno,
sure, here’s a screenshot of the workflow.

Jonas

Hi Jonas,

I created a test environment. The contact has “Meeing Time” and “Meeting Time DE” properties. I change the “Create record” action to “Copy property value” to copy the “cx___demodesk__meetinglink” to “Meeting Time DE”, and the result is correct.

Cereno

Hello @Cereno-Deng

Thanks for this. I have a similar issue. I am wondering how can we convert the UNIX timestamp above to a Date & Time Picker property on Hubspot?