public static long calculateDuration(int dayCount){
  if (dayCount == 0) {
    return Integer.MAX_VALUE;
  }
  Calendar cal=Calendar.getInstance();
  cal.add(Calendar.DATE,+dayCount);
  return ((cal.getTimeInMillis() - System.currentTimeMillis()) / 1000);
}

public static long calculateDuration ( int dayCount ) { if ( dayCount == 0 ) { return Integer . MAX_VALUE ; } Calendar cal = Calendar . getInstance ( ) ; cal . add ( Calendar . DATE , + dayCount ) ; return ( ( cal . getTimeInMillis ( ) - System . currentTimeMillis ( ) ) / 1000 ) ; }
calculates the timestamp when a given number of days is over
