Simple String to Date Workflow using Custom Code

Looking for a simple way to use the custom code within a workflow to take a string field, convert it to a date and post it into a new fields that is a “date picker” field.

My CRM cannot send a unix timestamp so I am forced to send dates as strings.

I have 3 fields that look like this “8/1/2021”. I need to take that and turn it into a date that Hubspot will accept in a Date Picker field.

I am a novice with Java but understand other languages enough to get through certain things I need, but havent been able to solve this one even though it seems it should be easy. Open to someones ideas on how to solve this another way OR by simply helping me with code that HubSpot’s custom code will accept.

Hey @NBorunda,

Here’s a working example you could utilize. You’ll need to alter the variable for your specific field, but that should give you the export you’re looking for.

Thank you, this got me far enough to figure it out!