title: Time comparison in java
body: <p>I would like to compare the string time format, For example
  Is there any other api provided by someone?</p>
  
  <pre><code>public void test() {
  
      Stirng t1 = "10:30 AM"; // 12-hours format
      Stirng t2 = "11:30 AM"; // 12-hours format
              &lt;or&gt;
      Stirng t1 = "10:30"; // 24-hours format
      Stirng t2 = "11:30"; // 24-hours format
  
      if(t1.before(t2)) {
          System.out.println(t1 + " is before of " + t2);
      }
  }
  </code></pre>