I need to display the value of the TIMEOUT attribute only HH: mm (hour and minutes). By including the masks below an error occurs:
The input string was not in an incorrect format.
I've tried both ways:
@dia.HORAINICIO.ToString(@"hh:mm tt")
@dia.HORAINICIO.ToString("{0:t}")
My Annotation date is as follows:
[Display(Name = "Hora Inicial:")]
[DataType(DataType.Time)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:HH:mm}")]
public TimeSpan HORAINICIO { get; set; }