I am trying to make a workflow to convert the text property with unixtimestamp into a date & time picker property so I can use this data to delay some emails.
Also, in the next action, I need to again conver the unixtimestamp text property into a readable format like this Wednesday, January 25, 2025 11:00 AM EST
Actually I am going to use the Delay option with the Date property.
What I want to do is to send email 1 hour before the contacts’ registered class starting so that we can send them the class link to join. To do that, I need to have their registered class date as a date & time property. So, I can add this to the Delay option in workflows.
However, we use a 3rd party form called Formcrafts to have the conditional logic (Our Hubspot plan does not cover this feature). And there is no date & time property in there. So, we use a text property. So the user make a selection from one of the two next classes.
Then, when there is a submission Formscraft send this data to Hubspot. But since the field is text, I can only send to Hubspot as a text.
It’s possible to add value to each text option. So, I converted each class date&time into ISO 8601 and UNIX and tried to send this directly to a Date&time picker property, but Formcraft does not send the time data in there for ISO one. For UNIX one, the date is somehow break down and show a date that is 300 years ago.
So, I thought the only option left is to turn the text data into date&time on Hubspot with a custom code.
let’s say you have variable x where you are storing the date property.
var parsedDate= Date.parse(x);
var substractedDate = parsedDate-360000;
var finalDate = new Date(substractedDate );
in the finalDate you will get the 1 hour substracted time stamp and then you can use it as per your requiremnt.
if this doesn’t solve your issue, please share the dated string property along with its string text.
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!