Java Hour Calculate isHourMinute(String str)

Here you can find the source of isHourMinute(String str)

Description

is Hour Minute

License

Apache License

Declaration

public static boolean isHourMinute(String str) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;

public class Main {
    public static boolean isHourMinute(String str) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
        dateFormat.setLenient(false);/*w w w. j  a v  a 2 s  .c  o  m*/
        try {
            dateFormat.parse(str);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. getTimestampFromDateHour2(String d)
  2. getTimeStringOfHourBefore(int hour)
  3. getTomorrowSixHours()
  4. getWeeHours()
  5. hoursMinsSecsFromMs(long ms)
  6. isValidTime(int hour, int minute, boolean ampm)
  7. isValidTime(int hour, int minute, boolean ampm)
  8. parseDate(String date, String hours)
  9. plusHour(int hour)