I need to format the time like this 00h30m.
Is there an easy way to do this that I am missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I like @Brandon’s approach (and upvoted it). An alternate approach would be to use
String.Format.String.Format("{0}h{1}m", DateTime.Now.Hour, DateTime.Now.Minute);You could encapsulate any approach in an extension method if you really wanted to.