Date Format Conversion in Linq

Hi,

i try to convert the date format using Linq. i have n no. of rows and columns… in that datatable have Date columns… The Date columns format have to change …

Input:

dd-MM-yyyy

Expected Output
yyyy-MM-dd
yyyy-MM-dd
yyyy-MM-dd

Without losing other data…in the datatable…

Thanks
Shyam

Hey @Shyam_Pragash,

Have a look on the below thread, this might be helpful.

Thanks,
Sanjit

Hi @Shyam_Pragash

kindly refer this post

Thanks

Hi @Shyam_Pragash ,

Check this below workflow attached:-
DateConversion_To_SpecifiedFormat.xaml (10.0 KB)

Hope this may help you :slight_smile:

Datetimes don’t have a format. Are the columns actually datetime or are they string?

And why Linq when you can just use a For Each Row and Assign? Simpler to code, simpler to interpret later.

Because sometimes I need to understand the linq also as well if you can tell me then please tell me how to filter date format like - (02-december-2022), using linq ?
Thanks,
sanjana.

Hi @Sanjana1
Welcome to UiPath community

’ ’ ’ DT.AsEnumerable.Where(Function(x)CDate(x(“Date”).ToString). Date= CDate(“02-december-2022”).Date) ’ ’ ’