Convert 24 hr format to 12 hr format
<p>This might be really easy but I can't figure it out. I am trying to convert the 24 hr time to a 12 hr time to display on the UI.</p>

<pre><code>var hrs = '&lt;%=Model.Scheduled.Value.Hour%&gt;';
var hrs12 = hrs &gt; 12 ? hrs - 12 : hrs;
$("#ScheduledHour").val(hrs12);
</code></pre>

<p>But the above is not working coz hrs is a string. Any suggestions on how to get this working?</p>
