-1
I need to format a date as follows:
Ex: 08:00 -> is 8h 08:30 -> is 8:30
You can do it right through DateTime.ToString()
;
-1
I need to format a date as follows:
Ex: 08:00 -> is 8h 08:30 -> is 8:30
You can do it right through DateTime.ToString()
;
8
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")
Browser other questions tagged c#
You are not signed in. Login or sign up in order to post.
The
toString
accepts format definition - https://msdn.microsoft.com/pt-br/library/8kb3ddd4(v=vs.110). aspx– rLinhares