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")
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")
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