Change date from excel


#1

Hi guys,

I have the folliwing problem. i read an excel file in which dates are currently present under the collum “GRANT DATE”. The dates are in the following format 27-2-15. I require however that the dates are copied into a website via the following format. 27-feb-2015. i tried to do this via the get row item and assign .tostring(“DD-MMM-YYYY”). However, when i paste the variable into the website it just copies the DD-MMM-YYYY.

I am pasting the value as gDateAfter.tostring.

Could anyone please assist?:slight_smile:

Please see the attached screenshotuipath%20help


#2

Hi @Matthewvz,

Get your date from the excel as string and convert it as date in assign activity as below

Assign to a date variable: Convert.ToDateTime(dt.Rows(0)(“YourDate”).ToString).Date

Then while feeding it in your website convert your date as below

DateTime.ParseExact(convertedDate.ToString(“MM.dd.yyyy”), “MM.dd.yyyy”, Nothing).ToString(“dd-MM-yyyy”)


#3

Hi Sarathi!

Thank you for your swift reply. Could you please provide me with an example as i am struggeling with the entire proces. For example: the get row item function gets a genericvalue not a string. My Collum name is “GRANT DATE” and it contains several rows with dates as described above.

Thank you so much already:)


#4

@Matthewvz Reger below link


#5

Hi indra,

thank you for clarifying. Maybe i was not clear. Whenever i try this method uipath changes the day and month to month and day (MM/DD/YYYY instead of DD/MM/YYYY). also even if i give it the command to print as .tostring("dd/MMM/YYYY) it still gives the output as 08/01/2016 instead of 08/jan/2016. Do you have any way to resolve this?


#6

Try this (dd/MMM/yyyy)


#7

Hi,

If still you are facing problem then check this link,