Getting error while convertion of date format

Hi guys, I’m getting an error while convertion of date.

This is my input and after splitting those dates I’m getting output like this

I’m looping this output codes into browser field using typeinto activity, bot is throwing error this is not a date and time format.
Can anyone help me how to solve this.

Hi @ranaprathap928

Did u spilt the date using Spilt function and & as delimiter

Hi @NIVED_NAMBIAR I’m splitting those dates first based on (&) I’m writing in excel. After that I’m looping those into my browser and again I’m converting those dates

Hi @ranaprathap928

While reading the excel file (after splitting the data and writing to excel) using read range tick preserve format option in read range to preserve the format of date

It will rectify ur error

Mark it as solution if it resolves ur query


Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

Sure @NIVED_NAMBIAR i will check this

1 Like

@NIVED_NAMBIAR still I’m getting same error


Check as below

If you are getting date as number and need to change to date format, then check below

Hope these helps you


Hi @ranaprathap928

Can u try like this

date_1= DateTime.ParseExact(Excel_Date,“dd-MM-yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Try this way with preserve format option being checked


Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

@NIVED_NAMBIAR I’m getting error

After splitting my both dates (18-05-2020 & 02-15-2020) both are in different format that’s y it’s showing error.

hi @ranaprathap928

Can u show the date in by using Excel_date variable in writeline?

@NIVED_NAMBIAR sure 1 minute


This is the input and after splitting I’m getting like this

Is third one is the output u are getting when u use .ToString?

@NIVED_NAMBIAR 18-05-2020 & 02-15-2020 this is my input , and I’m splitting that into 2 dates based on (&) and my output is 1) 18-05-202 and 2) 2/15/2020 I’m writing this in a excel in two different cells (A1 ,A2). after that I’m looping this into browser form .when I’m looping it is throwing error this is not a correct date format

UipathForumQuestion.xaml (12.3 KB)

please check this code, hope this will resolve the issue

Thanks @shaik_Azam it’s working

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.