Example usage for java.time LocalDateTime minusMinutes

List of usage examples for java.time LocalDateTime minusMinutes

Introduction

In this page you can find the example usage for java.time LocalDateTime minusMinutes.

Prototype

public LocalDateTime minusMinutes(long minutes) 

Source Link

Document

Returns a copy of this LocalDateTime with the specified number of minutes subtracted.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00);

    LocalDateTime t = a.minusMinutes(100);

    System.out.println(t);// w  w  w .  j ava 2  s  . c  om
}

From source file:nu.yona.server.device.service.DeviceServiceTestConfiguration.java

private Activity makeActivity(LocalDateTime startTime, ActivityData activityData, UserDevice device) {
    LocalDateTime activityStartTime = startTime.minusMinutes(activityData.minutesAgo);
    return activityRepository.save(Activity.createInstance(device.getDeviceAnonymized(),
            ZoneId.of("Europe/Amsterdam"), activityStartTime,
            activityStartTime.plusMinutes(activityData.durationMinutes), Optional.of(activityData.app)));
}

From source file:no.kantega.openaksess.search.searchlog.action.ViewSearchLogAction.java

private void defaultSearch(Map<String, Object> model, int siteId) {
    LocalDateTime now = LocalDateTime.now();
    LocalDateTime thirtyMinutesAgo = now.minusMinutes(30);
    model.put("last30min", searchLogDao.getSearchCountForPeriod(thirtyMinutesAgo, now, siteId));

    LocalDateTime oneMonthAgo = now.minusDays(30);
    model.put("sumLastMonth", searchLogDao.getSearchCountForPeriod(oneMonthAgo, now, siteId));

    model.put("most", searchLogDao.getMostPopularQueries(siteId, 100));
    model.put("least", searchLogDao.getQueriesWithLeastHits(siteId, 100));
}