Blazor

Why is the DateTime 24-hours conversion to AM/PM is not working?

Why is the DateTime 24-hours conversion to AM/PM is not working?

You have to use the format-value string “yyyy-MM-ddTHH:mm” to work with AM/PM conversion properly.

<input type="datetime-local" id="Test" name="Test" class="form-control" @bind="@testDateTime" format-value="yyyy-MM-ddTHH:mm" />

@code {
    DateTime testDateTime { get; set; } = new DateTime(2019, 12, 15, 16, 45, 15);
}

I would suggest you check the below link for better understanding:
https://github.com/aspnet/AspNetCore/issues/9727

Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.