I have an Excel file where I have a date in format ”02.10.2015” (dd.MM.yyyy) as a string.
I need to input that date to a website but I also need to add some dates to that date.
For example, first I need to input the actual date ”12.10.2015” and second I want input a day after it like ”13.10.2015”.
I use get row item to get the first date from an excel, save the output to ”mydate” variable and then I use it straight in type into activity. After that I want to have a day after that so I use the assign activity to change date from a string to DateTime like this:
But it doesn’t work and it gives me this error sign : ” Assign: String was not recognized as a valid DateTime. ”
Both of the variable types are GenericValue, but when I change them into DateTime -type the error ”Option Strict On disallows implicit conversions from ‘String’ to ‘Date’" occurs……
Any tips or ideas why this doesn’t work? Or if there are some better ways to do it, I would be more than grateful to hear Thank you already!
Yeah mydate is actually used several times before I want to add dates to it. So would you suggest to take the date out again by get row item and save it for another variable and use that ParseExact sentence, would it help? Or do you think there is there easier way to do this? thanks
Datetimes will always include the time, but if you need to get just the date as 12.31.2014, you can always convert that date with .ToString("MM.dd.yyyy").
Oh sorry, I meant it as “dd.MM.yyyy”. but since I forgot to put .ToString("dd.MM.yyyy") into another assign activity I had it in the wrong (12/31/2014 00:00:00) format. But anyhow that works now!!! Thank you a lot for your help (I’ve been struggling with this the whole day so this really made my day) thanks.