I have a component workflow that takes a date/datetime value from Salesforce and enters the date into a task form. The date in the form is different than the date in the workflow, and I am wondering how I can fix that.
Example: In the workflow, if I use log to instance details, I can see that the date value is for example "2020-05-05." (May 5th, 2020). However, in the task form, this date will appear on a date form field as May 4th, 2020. And if I show the time on the form control, it will be May 4th, 2020 6:00pm.
Solved! Go to Solution.
@jwCbank yeah that's pretty weird. I have to assume it has to do with the date data being pulled and somehow converted to UTC and then trying to do some auto adjustment based on server time, but...not 100% sure without doing a comparison of your SFDC environment and where you're located.
You should be able to work around this with a two step process.
1. Leverage the 'Format date to string' action to ensure that the date variable is held in your local timezone (or forced to UTC)
2. Within your task form use the 'convertToDate' function to convert your txt variable back into a date as the default value:
Let me know if that helps!