I don’t know why this is so difficult, but I have been stuck for hours just to convert a string to a DateTime.
What I want to do is, create a workflow that receives in a string in format of “Month, year”, and return a string “Previous_Month, year” or if the “Month” is “January”, it needs to return “December, Previous_year”.
For example, if the in_argument is “March, 2019”, it needs to return as out_argument “February, 2019”.
If the in_argument is “January, 2019”, it needs to return “December. 2018”.
Since I don’t wanna have a big if statement with 12 branches, I want to convert this string to datetime so I can just “AddMonth(-1)” or “AddYear(-1)”. However, I am not sure how to convert this “month, year” into DateTime.
I first parsed the string using split, in assign activity.
Assign: ParseMonthYear = in_argument.Split(CChar(" "))
Now, I got Month and Year in ParseMonthYear(0) and ParseMonthYear(1), respectively, but now I can’t convert each piece of string into DateTime. How can you do this?