First convert the date in string and give it a format as per your need and the convert it back to DateTime. See,
String to DateTime
String MyString;
MyString = "1999-09-01 21:34 PM";
DateTime MyDateTime;
MyDateTime = new DateTime();
MyDateTime = DateTime.ParseExact(MyString, "yyyy-MM-dd HH:mm tt", null);
DateTime to String
MyDateTime = new DateTime(1999, 09, 01, 21, 34, 00);
String MyString;
MyString = MyDateTime.ToString("yyyy-MM-dd HH:mm tt");
For more reference, go here[^]
Good Luck :)
-KR