Package org.joda.time

Examples of org.joda.time.Days


    } else if (lastInvocation.getTime() >> 32 == Integer.MAX_VALUE) {
      // checks if invocation_time is close enough to 'infinity'.
      oldEnough = false;
    } else {
      DateTime lastInvocationDateTime = new DateTime(lastInvocation.getTime());
      Days daysBetween = Days.daysBetween(lastInvocationDateTime, new DateTime());
      oldEnough = daysBetween.getDays() > callType.getDaysToCache();
    }
    return oldEnough;
  }
View Full Code Here


        DateTime startDate = new DateTime(input.get(0).toString());
        DateTime endDate = new DateTime(input.get(1).toString());

        // Larger date first
        Days d = Days.daysBetween(endDate, startDate);
        long days = d.getDays();

        return days;

    }
View Full Code Here

        final AtomicInteger remainingInserts = new AtomicInteger(dataSet.size());

        for (final MeasurementDataNumeric data : dataSet) {
            DateTime collectionTimeSlice = dateTimeService.getTimeSlice(new DateTime(data.getTimestamp()),
                configuration.getRawTimeSliceDuration());
            Days days = Days.daysBetween(collectionTimeSlice, dateTimeService.now());

            if (days.isGreaterThan(rawDataAgeLimit)) {
                log.info(data + " is older than the raw data age limit of " + rawDataAgeLimit.getDays() +
                    " days. It will not be stored.");
            } else {
                StorageResultSetFuture rawFuture = dao.insertRawData(data);
                StorageResultSetFuture indexFuture = dao.updateIndex(IndexBucket.RAW, collectionTimeSlice.getMillis(),
View Full Code Here

              numDays.put(sldn, new ArrayList<Integer>());
            }
            Date pd = rs3.getDate(2);
            DateTime start = new DateTime(pd.getTime());
            DateTime end = new DateTime(log_date.getTime());
            Days d = Days.daysBetween(start, end);
            int diffDays = d.getDays();
            numDays.get(sldn).add(diffDays);
          }
        } catch (Exception e){
          if(log.isErrorEnabled()){
            log.error(e);
View Full Code Here

          pd = d;
          windowcount++;
        } else {
          DateTime morerecent = new DateTime(d.getTime());
          DateTime lessrecent = new DateTime(pd.getTime());
          Days days = Days.daysBetween(morerecent, lessrecent);
          windowcount += days.getDays();
          pd = d;
        }
        prevDates.add(d);
      }
     
View Full Code Here

        DateTime startDate = new DateTime(input.get(0).toString());
        DateTime endDate = new DateTime(input.get(1).toString());

        // Larger date first
        Days d = Days.daysBetween(endDate, startDate);
        long days = d.getDays();

        return days;

    }
View Full Code Here

        DateTime startDate = new DateTime(input.get(0).toString());
        DateTime endDate = new DateTime(input.get(1).toString());

        // Larger date first
        Days d = Days.daysBetween(endDate, startDate);
        long days = d.getDays();

        return days;

    }
View Full Code Here

    final DateTime previous = new DateTime(lastRunTime);

    final DateTime current = new DateTime(DateTimeZone.UTC);

    final Days days = Days.daysBetween(previous, current);

    final int count = days.getDays();

    if (count > 1) {
      return true;
    }
View Full Code Here

    public Duration getLengthBetween() {
        return lengthBetween;
    }

    public Fraction getProportion(DateTime date) {
        Days fromStartToDate = Days.daysBetween(startInclusive,
                date.toLocalDate());
        Fraction result = Fraction.getFraction(fromStartToDate.getDays(),
                this.daysBetween.getDays());
        try {
            return result.add(inTheDayIncrement(date));
        } catch (ArithmeticException e) {
            return result;
View Full Code Here

    public static BigDecimal calculateRealDurationFor(MonteCarloTask task, BigDecimal daysDuration) {
        LocalDate start = task.getStartDate();
        Validate.notNull(start);
        LocalDate end = calculateEndDateFor(task, daysDuration);
        Days daysBetween = Days.daysBetween(start, end);
        return BigDecimal.valueOf(daysBetween.getDays());
    }
View Full Code Here

TOP

Related Classes of org.joda.time.Days

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.