I need to format a date as follows:
Ex: 08:00 - > It's 8am 08:30 - > It's 8:30 a.m.
You can do this directly through DateTime.ToString()
;
I need to format a date as follows:
Ex: 08:00 - > It's 8am 08:30 - > It's 8:30 a.m.
You can do this directly through DateTime.ToString()
;
Simple:
DateTime.Parse("01/08/2017 08:30:00").ToString(@"HH\hmm")
If you want without 0 before 8, just change:
DateTime.Parse("01/08/2017 08:30:00").ToString(@"H\hmm")