Covert column in specific date format

Hi Team,

today’s query is that I have a column which contains some date like format dd-MM-yyyy

now I have to convert that whole column in specific date format using linq.

required format : MM/dd/yyyy

pleae help me because this process already running in production.

Hi @Lakshya_Garg2

Use this in Invoke Code activity

dt.AsEnumerable().ToList().ForEach(Sub(row) row("DateColumn") = DateTime.ParseExact(row("DateColumn").ToString(), "dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy"))

Regards,

Hi @Lakshya_Garg2

Please refer the below thread

@Lakshya_Garg2

Another approach

Regards,

Hie @Lakshya_Garg2 use this method
input
image
process
image
inside for each use this to store the column value
image
and use this logic to converted your date time


in the last on the code change (“yyyy-MM-dd”) to (“MM/dd/yyyy”) so you get your desired output
cheers Happy Automation

Hi,

thanks for the help but this is not working

@Lakshya_Garg2

Can you please share the sample excel file

Regards,

Samplefile.xlsx (15.8 KB)

please find attached sample file

@Lakshya_Garg2

Output:

Regards,

I try this solution and let you know, is it working or not

1 Like