Hour from DateTime? in 24 hours format

You can get the desired result with the code below. Two ‘H’ in HH is for 24-hour format.

return fechaHora.Value.ToString("HH:mm");

Leave a Comment