I'm trying different things like different DataFormatString or even different controls to make it so it use 24 format but it keeps on AM/PM format, how to make it 24hs format?
EDIT: After more searching I realize this same code shows 24 hours format to some people, so I could reformulate to: What could be configured as AM/PM in my PC? I already changed the locale in web.config to a 24 hrs locale but the result is the same. My regional settings is also 24 hours time.
View:
<div class="col-md-2">
Horario teórico Desde
@Html.EditorFor(model => model.HorarioTeoricoDesde, new { htmlAttributes = new { @class = "form-control form-control-sm" } })
@Html.ValidationMessageFor(model => model.HorarioTeoricoDesde, "", new { @class = "text-danger" })
</div>
ViewModel:
[Display(Name = "Horario Teorico Desde")]
[Required(ErrorMessage = "El Horario Teorico Desde es Requerido")]
[DataType(DataType.Time)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:HH:mm}")]
public DateTime? HorarioTeoricoDesde { get; set; }
My Regional settings are 24 hs, spanish language. This is my web.config:
<system.web>
<globalization culture="es-AR" uiCulture="es-AR" />
This is how i see it:
Thanks!!