Hi Guys.
I am passing this ‘str_User_DepDate’(which holds the date read from excel) variable to another workflow, where the argument’s data type is ‘DateandTime’
and I have converted the string to date and time by using this ‘Convert.ToDateTime(str_User_DepDate)’ but I am getting this error stating;
“Invoke WebDataExtraction workflow: String ‘15/09/2022’ was not recognized as a valid DateTime.” Any idea on how to solve this?
Your help is much appreciated.
Regards
Chendoran
jack.chan
(Jack Chan)
August 4, 2022, 5:30am
2
try this instead to convert your string to datetime
Datetime.parseExact(str_User_DepDate, "dd/MM/yyyy", nothing)
Veera_Raj
(Veeraraj Sethuraman)
August 4, 2022, 5:31am
3
can you tell me bit are you trying to convert to other format?
DateTime.ParseExact(strIn, “dd/MM/yyyy”,System.Globalization.CultureInfo.InvariantCulture)
try this
Gokul001
(Gokul Balaji)
August 4, 2022, 5:40am
4
Hi @Chendoran_M
Can you confirm that your passing str_User_DepDate from one workflow to another workflow correct?
If yes, What are the Variable and Argument type?
Regards
Gokul
The passing of the variable is correct. The variable is of type string and the argument is of type DateTime.
Gokul001
(Gokul Balaji)
August 4, 2022, 6:03am
6
Change the Argument type to String and check it
Regards
Gokul
Hey!
Try this…
Datetime.ParseExact(Strinput.ToString, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")
Regards,
NaNi
Didn’t work. Got this error again,
System.FormatException: String ‘22/03/2023’ was not recognized as a valid DateTime.
This has worked. Thank you @jack.chan
1 Like
system
(system)
Closed
August 7, 2022, 7:23am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.