I have the following code in my model:
[DisplayFormat(DataFormatString = "{0:HH:mm}", ApplyFormatInEditMode = true)]
[DataType(DataType.Time)]
public DateTime Start { get; set; }
And in my cshtml form:
<input asp-for="Start" class="form-control" asp-format="{0:HH:mm}" />
In Chrome and Edge the input displays 11:00 PM instead of 23:00. I expect that HH means 00-23, at least as far as I understood.
This is what Chrome tells me if I put a wrong format, e.g. {0:something}.
The specified value "12:00 AM" does not conform to the required format. The format is "HH:mm",
"HH:mm:ss"
or"HH:mm:ss.SSS"
where HH is 00-23, mm is 00-59, ss is 00-59, and SSS is 000-999.
I'm not sure where I'm going wrong. How can I get 24h notation?