-5

i have a datetime field whih is showing date time as 11/03/14 12:00 AM.How can i convert this time to 00:00 instead of 12:00 AM.

i tried

    DateTime.ToString("hh:mm tt")
Cronaldo
  • 99
  • 1
  • 12

1 Answers1

0

You need to convert it first to DateTime, then you could use ToShortDateString:

DateTime dt = DateTime.ParseExact("11/03/14 12:00 AM", "dd/MM/yy hh:mm tt", CultureInfo.InvariantCulture);
string result = dt.ToShortDateString();

Read: http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939