title: How to make JS parse 12 hour input format into 24 or
body: <p>Hope to get some help with this. I am total novice to JS. I have to write a script that asks user for the current hour. That's easy. If the hour is between 6am and 9 am, it will give certain prompt. If the hour is between 11 am and 1 pm, another prompt. If between 5 pm and 8 pm, prompt. My issue is how to have JS understand when user enters let's say number 5, that it is 5 pm (time for dinner) and not 5 am (go get snack). Please, help me. What would be solution to my problem? No one in the US really uses 24 hour format so numbers 13 (1pm), 17(5pm) or 20(8pm) in my script wont work. I can only have inputs in 12 hour time format.</p>
  
  <pre><code>var hour=prompt("What is the current hour? ","");
  
    if( hour &gt;= 6 &amp;&amp; hour &lt;= 9 ){
      alert("Breakfast is served.");
    }
    else if( hour &gt;=11  &amp;&amp; hour &lt;= 13 ){
      alert("Time for lunch.");
    }
    else if( hour &gt;=17  &amp;&amp; hour &lt;= 20 ){
      alert("It's dinner time.");
    }
    else {
      alert("Sorry, you'll have to wait, or go get snack.");
    }
  </code></pre>