fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. static string FormatTime(DateTime dt) {
  6. return string.Format("{0}h{1:##m;;}", dt.Hour, dt.Minute);
  7. }
  8.  
  9. public static void Main()
  10. {
  11. var a = new DateTime(2017, 8, 7, 15, 37, 9);
  12. var b = new DateTime(2017, 8, 7, 15, 0, 11);
  13. Console.WriteLine(FormatTime(a));
  14. Console.WriteLine(FormatTime(b));
  15. }
  16. }
Success #stdin #stdout 0s 131648KB
stdin
Standard input is empty
stdout
15h37m
15h