Hi
I want to display separate DateTime in below code. It should be in dd-mm-yyyy format.
15/12/2022 22:30:41
Thanks
Hi ramco1917,
Use DateTime.ParseExact method.
string dt = "15/12/2022 22:30:41"; string _date = DateTime.ParseExact(dt, "dd/MM/yyyy HH:mm:s", System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy");
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.