private static String handleTime(List<String> tokens,Iterator<String> iter){
  DateTime dt=new DateTime();
  if (iter.hasNext()) {
    String operationToken=iter.next();
    if (operationToken.equals("+") || operationToken.equals("-")) {
      if (iter.hasNext()) {
        String quantityToken=iter.next();
        ReadablePeriod period=getTimePeriod(quantityToken);
        if (operationToken.equals("-")) {
          dt=dt.minus(period);
        }
 else {
          dt=dt.plus(period);
        }
      }
 else {
        logger.warn("Token '{}' not followed by a quantity",operationToken);
      }
    }
 else {
      logger.warn("Invalid token '{}', must be operator '+' or '-'",operationToken);
    }
  }
  return DATE_UTIL.formatDateTime(dt);
}

private static String handleTime ( List < String > tokens , Iterator < String > iter ) { DateTime dt = new DateTime ( ) ; if ( iter . hasNext ( ) ) { String operationToken = iter . next ( ) ; if ( operationToken . equals ( "+" ) || operationToken . equals ( "-" ) ) { if ( iter . hasNext ( ) ) { String quantityToken = iter . next ( ) ; ReadablePeriod period = getTimePeriod ( quantityToken ) ; if ( operationToken . equals ( "-" ) ) { dt = dt . minus ( period ) ; } else { dt = dt . plus ( period ) ; } } else { logger . warn ( "Token '{}' not followed by a quantity" , operationToken ) ; } } else { logger . warn ( "Invalid token '{}', must be operator '+' or '-'" , operationToken ) ; } } return DATE_UTIL . formatDateTime ( dt ) ; }
handles the time . now macro
