I need to create a <select> in my view an <option> for each hour (all 24 of them), localized to the current thread’s time format.
How can I do this?
The output for en-US should look like:
<select>
<option value="0">12:00 AM</option>
<option value="1">1:00 AM</option>
...
<option value="12">12:00 PM</option>
</select>
So far I’ve got:
<% For hour As Integer = 0 To 23 %>
<option value="<%= hour.ToString() %>"></option>
<% Next %>
Try this: