Need your expertise. I am trying to fetch date from data table cell which is in “22-Dec-2022” format. I would need to convert this format as ‘12222022’.
Tried to convert the format by using “date.ParseExact(dtQuoteData.Rows.Item(22)(12).ToString, “DDMonYYYY”, system.Globalization.CultureInfo.InvariantCulture).ToString(“MMDDYY”)” but getting exception “Assign: String ‘22-Dec-2022’ was not recognized as a valid DateTime.”
Can someone please help me resolve this error? Thanks!
Welcome to UiPath community
Datetime.ParseExact(dtQuoteData.Rows.Item(22)(12).ToString, “dd-MMM-yyyy”, system.Globalization.CultureInfo.InvariantCulture).ToString(“MMddyyyy”)”
The expression you used is correct…but the formats are as follows
Output - MMddyyyy
And also verify if you have time also in the variable…generally in excel you might not see but time might be there…if so use hh:mm:ss
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.