Compare Time returned in string format by converting it to 24 hour format in javascript : <p>I am making an ajax call and getting a JSON response. In the response I am getting time in following format:</p>

<pre><code>12:00 pm //typeof of this is String.
</code></pre>

<p>I need to compare this time with the other times returned and find the earliest time.</p>

<p>What would be the best way of doing this?
I was thinking of converting it to 24 Hour format in int and then directly compare, but how can we convert this to 24 hour format in the best way?</p>
