achyu
1
Hello All,
I’m getting an error while calculating the differences between current date and the date from my excel (end_day). Both formats are same (YYYY-MM-DD)
Attached the screenshot of the error
Kindly let me know how to fix this issue.
Thanks
d.motta
2
Hi @achyu!
You need to read data from Excel document by using “Read Excel Cell” activity and then change the format for every row.
You can also use a loop to process the data for each row where
i
variable is a value of the row:
2 Likes
Zohari
4
Hi @achyu here is how you can calculate the date difference.
To calculate the date difference:
- Set two variables with a valid date format
- Add the Calculate difference activity
- Set the “Initial date” parameter using the variable name set in step 1 or use the “Set a value” picker
- Set the date to subtract the parameter using the variable name set in step 1 or use the “Set a value” picker
- Save the result using the Assign value to variable activity (added by default)
Note: Studio Pro also supports date management using the Moment Js library.
Example:
1moment().format('MMMM Do YYYY, h:mm:ss a'); // December 19th 2022, 7:47:27 pm 2moment().format('dddd'); // Monday 3moment().format("MMM Do YY"); // Dec 19th 22 4moment().format('YYYY [escaped] YYYY'); // 2022 escaped 2022 5moment().format();
Bear in mind that the MomentJs library methods must be used in the “Calculate a value” parameter of the Assign value to variable activity.