Conversion to standard date format

Hello,
Im trying to take the date column from the excel which is of mixed format i.e dd/mm/yyyy and mm-dd-yyyy. I want to convert this column into the standard date format i.e mm/dd//yy. Can anyone give a solution for this.

@KeertiJ

  1. use Read Range activity to read data from excel and give you output as ‘dataTable’

  2. Then use For Each Row activity to iterate that dataTable

                                ForEach row in dataTable
                                   If row("DateColumn").Tostring.Contains("/")
                                   Then row("DateColumn") = "Datetime.parseexact(row("DateColumn").Tostring,“dd/MM/yyyy”,system.globalization.cultureinfo.invariantculture).tostring(“MM/dd/yy”)
                                   If row("DateColumn").Tostring.Contains("-")
                                   Then row("DateColumn") = "Datetime.parseexact(row("DateColumn").Tostring,“MM-dd-yyyy”,system.globalization.cultureinfo.invariantculture).tostring(“MM/dd/yy”)
    
  3. And then finally use Write Range activity to write into excel file.

1 Like