Package org.joda.time

Examples of org.joda.time.DateTime.minus()


    }
  }

  public void removeExpiredUnverifiedAccounts() {
    DateTime currentDate = getCurrentTime();
    Date threshold = currentDate.minus(UnverifiedAccount.EXPIRATION_PERIOD)
        .toDate();

    int removedAccounts = entityManager
        .createQuery(
            "delete " + UnverifiedAccount.class.getName()
View Full Code Here


    }

    public static String getDataPreviousMesi(int numeroMesi) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
        return now.minus(noUpdatePeriod).toString();
    }

    public static String getDatapreviousMesiFormattata(int numeroMesi, String regexp) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
View Full Code Here

    }

    public static String getDatapreviousMesiFormattata(int numeroMesi, String regexp) {
        DateTime now = new DateTime();
        ReadablePeriod noUpdatePeriod = new Period().withMonths(numeroMesi);
        return new SimpleDateFormat(regexp).format(now.minus(noUpdatePeriod).toDate());
    }
}
View Full Code Here

      return false;
    }

    DateTime lastShouldRun = monitor.getLastShouldHaveRun();
    DateTime nextRun = lastShouldRun.plus(timePeriod);
    if(now.isAfter(nextRun.minus(1000))) {
      monitor.setLastShouldHaveRun(nextRun);
      return true;
    }
    return false;
  }
View Full Code Here

    DateTime lastShouldRun = monitor.getLastShouldHaveRun();
    DateTime nextRun = lastShouldRun.plus(timePeriod);
    if(log.isDebugEnabled())
      log.debug("nextRun="+nextRun+" now="+now+" lastShouldRun="+lastShouldRun);
    if(now.isAfter(nextRun.minus(1000))) {
      monitor.setLastShouldHaveRun(nextRun);
      return true;
    }
    return false;
  }
View Full Code Here

    DateTime t = DateTime.now();
    Interval interval = new Interval(t.minusMinutes(1), t.plusMinutes(1));

    index.add(
        new MapBasedInputRow(
            t.minus(1).getMillis(),
            Lists.newArrayList("billy"),
            ImmutableMap.<String, Object>of("billy", "hi")
        )
    );
    index.add(
View Full Code Here

            ImmutableMap.<String, Object>of("billy", "hi")
        )
    );
    index.add(
        new MapBasedInputRow(
            t.minus(1).getMillis(),
            Lists.newArrayList("sally"),
            ImmutableMap.<String, Object>of("sally", "bo")
        )
    );
View Full Code Here

    dimSelector = cursor.makeDimensionSelector("sally");
    Assert.assertEquals("bo", dimSelector.lookupName(dimSelector.getRow().get(0)));

    index.add(
        new MapBasedInputRow(
            t.minus(1).getMillis(),
            Lists.newArrayList("sally"),
            ImmutableMap.<String, Object>of("sally", "ah")
        )
    );
View Full Code Here

    );

    DateTime t = DateTime.now();
    index.add(
        new MapBasedInputRow(
            t.minus(1).getMillis(),
            Lists.newArrayList("sally"),
            ImmutableMap.<String, Object>of("sally", "bo")
        )
    );
View Full Code Here

        final DateTime oldestPortalEventTimestamp = this.portalEventDao.getOldestPortalEventTimestamp();
        if (oldestPortalEventTimestamp == null || now.isBefore(oldestPortalEventTimestamp)) {
            startIntervalInfo = this.intervalHelper.getIntervalInfo(AggregationInterval.YEAR, now.minus(this.dimensionBuffer));
        }
        else {
            startIntervalInfo = this.intervalHelper.getIntervalInfo(AggregationInterval.YEAR, oldestPortalEventTimestamp.minus(this.dimensionBuffer));
        }
       
        final AggregationIntervalInfo endIntervalInfo;
        final DateTime newestPortalEventTimestamp = this.portalEventDao.getNewestPortalEventTimestamp();
        if (newestPortalEventTimestamp == null || now.isAfter(newestPortalEventTimestamp)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.