public static long convertStringToFutureTimeMillis(String time){
  Calendar exp=Calendar.getInstance();
  if (time.endsWith("H")) {
    exp.add(Calendar.HOUR,Integer.valueOf(StringUtils.remove(time,'H')));
  }
 else   if (time.endsWith("M")) {
    exp.add(Calendar.MINUTE,Integer.valueOf(StringUtils.remove(time,'M')));
  }
 else   if (time.endsWith("S")) {
    exp.add(Calendar.MILLISECOND,Integer.valueOf(StringUtils.remove(time,'S')) * 1000);
  }
  return exp.getTimeInMillis();
}

public static long convertStringToFutureTimeMillis ( String time ) { Calendar exp = Calendar . getInstance ( ) ; if ( time . endsWith ( "H" ) ) { exp . add ( Calendar . HOUR , Integer . valueOf ( StringUtils . remove ( time , 'H' ) ) ) ; } else if ( time . endsWith ( "M" ) ) { exp . add ( Calendar . MINUTE , Integer . valueOf ( StringUtils . remove ( time , 'M' ) ) ) ; } else if ( time . endsWith ( "S" ) ) { exp . add ( Calendar . MILLISECOND , Integer . valueOf ( StringUtils . remove ( time , 'S' ) ) * 1000 ) ; } return exp . getTimeInMillis ( ) ; }
converts a string denoting an amount of time into milliseconds and adds it to the current date . strings are expected to follow this form where # equals a digit : # m the following are permitted for denoting time : h = hours , m = minutes , s = seconds
