Exemplo n.º 1
0
  public int findMinutes() {

    String[] result = time.split(COLON);

    int hrs = new Integer(result[0]);
    int min = new Integer(result[1]);

    boolean am_pm = false;
    if (meridiem.equalsIgnoreCase(MERIDIEM.AM.toString())) am_pm = true;

    int mins = 0;
    if (hrs == 12) mins = 0 + min + (am_pm ? 0 : 12 * 60);
    else mins = (hrs * 60) + min + (am_pm ? 0 : 12 * 60);

    return mins;
  }