Hello Everyone,
I’ve some issue for LINQ method to convert date time format
Example:
dt1
Date
5/17/1986 00:00:00
7/05/1994 00:00:00
12/10/1973 00:00:00
Expected:
05/17/1986 00:00:00
07/05/1994 00:00:00
12/10/1973 00:00:00
Issue:
Anyone can help?
Regards,
Brian
ppr
(Peter Preuss)
2
At least this one ist to correct

the single digit 5 will need the parse format d/
but a 5/17/1986 is of format M/dd/yyyy
lrtetala
(Lakshman Reddy)
3
Hi @Brian_Henokh1
Can you try the following sample?
(From row In DT.AsEnumerable()
Let originalDate = DateTime.ParseExact(row.Field(Of String)("Dates"), "M/d/yyyy HH:mm:ss", System.Globalization.CultureInfo.CurrentCulture)
Select DT.Clone().Rows.Add(originalDate.ToString("MM/dd/yyyy HH:mm:ss"))
).CopyToDataTable()
I/P:

O/P:

Hope this helps!!
ppr
(Peter Preuss)
4