private static boolean isValidTime(String time) {
		if (time.length() != 4)
			return false;

		Integer hour, min;

		try {
			hour = Integer.parseInt(time.substring(0, 2));
			min = Integer.parseInt(time.substring(2, 4));
		} catch (Exception e) {
			return false;
		}

		if (hour == null || min == null) {
			return false;
		}

		if (min < 0 || min > 59)
			return false;

		if (hour < 0 || hour > 23)
			return false;

		return true;
	}