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);
}
Refer to this thread for more information.
Share with