How to format convert date from 2/10/2023 12:00:00 AM to 10-Feb-2023

Hello guys, please I need your help. @fernando_zuluaga

How can I convert this date: 2/10/2023 12:00:00 AM to 10-Feb-2023.

Thank you

Hi @Lamina_Zafrullah

give a try with

DateTime.ParseExact("2/10/2023 12:00:00 AM",{"M/d/yyyy","dd/MM/yyyy","d/M/yyyy","MM/dd/yyyy","MM/dd/yyyy hh:mm:ss", "M/d/yyyy h:mm:ss tt", "MM/dd/yyyy hh:mm:ss tt"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd-MMM-yyyy")

Regards

1 Like

Thank you @fernando_zuluaga You the best

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.