I have a date field in my excel in mm/dd/yyyy format but when i am running the same in UiPath I am getting completely different output(2nd screen attached), how to fix??
You can try as following:
Convert.ToDateTime(dateValue).ToString(“MM/dd/yyyy”)
not working.
Hope this expression would help you resolve this
DateTime.FromOADate(row(date).Tostring).ToString(“dd-MM-yyyy”)
Cheers @indrajit.shah
thankyou @Palaniyappan for your reply.
I am not using any for each or any loop and i need to convert this after reading the excel.
May I know how we are reading excel
We can replace the string inside the fromoadate method
Cheers @indrajit.shah
Fine
Then if the output of read range is named as dt
DateTime.FromOADate(dt.Rows(0)(0)).ToString(“dd-MM-yyyy”)
Cheers @indrajit.shah
1 Like
thankyou
it’s fixed just by changing the format to “text” in excel
Awesome
Cheers @indrajit.shah
1 Like