Example usage for java.time LocalTime NOON

List of usage examples for java.time LocalTime NOON

Introduction

In this page you can find the example usage for java.time LocalTime NOON.

Prototype

LocalTime NOON

To view the source code for java.time LocalTime NOON.

Click Source Link

Document

The time of noon in the middle of the day, '12:00'.

Usage

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.plus(4, ChronoUnit.DAYS);
    System.out.println(duration.getSeconds());

}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    System.out.println(duration.getSeconds());
    duration = duration.minus(3, ChronoUnit.DAYS);
    System.out.println(duration.getSeconds());

}

From source file:Main.java

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

    LocalDateTime l = a.atTime(LocalTime.NOON);
    System.out.println(l);/* www.  j ava 2  s . c o m*/
}

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.of(LocalDate.now(), LocalTime.NOON, ZoneOffset.UTC);

    System.out.println(o);//from   www  . j  ava 2s . c o m
}

From source file:Main.java

public static void main(String[] args) {
    Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON);
    List<TemporalUnit> l = duration.getUnits();
    for (TemporalUnit u : l) {
        System.out.println(u);/*from   w ww  .j  a  v a2 s.  c o  m*/
    }
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate february20th = LocalDate.of(2014, Month.FEBRUARY, 20);
    System.out.println(february20th);
    System.out.println(LocalDate.from(february20th.plus(15, ChronoUnit.YEARS))); // 2029-02-20
    System.out.println(LocalDate.MAX);
    System.out.println(LocalDate.MIN);

    System.out.println(LocalTime.MIDNIGHT); // 00:00
    System.out.println(LocalTime.NOON); // 12:00
    System.out.println(LocalTime.of(23, 12, 30, 500)); // 23:12:30.000000500
    System.out.println(LocalTime.now()); // 00:40:34.110
    System.out.println(LocalTime.ofSecondOfDay(11 * 60 * 60)); // 11:00
    System.out.println(LocalTime.from(LocalTime.MIDNIGHT.plusHours(4))); // 04:00
    System.out.println(LocalTime.MIN);
    System.out.println(LocalTime.MAX);

    System.out.println(LocalDateTime.of(2014, 2, 15, 12, 30, 50, 200)); // 2014-02-15T12:30:50.000000200
    System.out.println(LocalDateTime.now()); // 2014-02-28T17:28:21.002
    System.out.println(LocalDateTime.from(LocalDateTime.of(2014, 2, 15, 12, 30, 40, 500).plusHours(19))); // 2014-02-16T07:30:40.000000500
    System.out.println(LocalDateTime.MAX);
}

From source file:gov.ca.cwds.cals.service.ComplaintsService.java

@UnitOfWork(CMS)
protected List<ComplaintDto> getCountyLicenseCaseComplaints(String facilityNumber) {
    Map<LocalDate, List<CountyLicenseCaseComplaintInfo>> complaintsAggregation = countyLicenseCaseComplaintInfoDao
            .loadCountyLicenseCaseComplaintsByLicenseNumber(facilityNumber).stream()
            .collect(Collectors.groupingBy(CountyLicenseCaseComplaintInfo::getComplaintDate));
    List<ComplaintDto> complaints = new ArrayList<>(complaintsAggregation.size());
    for (Map.Entry<LocalDate, List<CountyLicenseCaseComplaintInfo>> entry : complaintsAggregation.entrySet()) {
        ComplaintDto complaintDto = new ComplaintDto();
        complaintDto.setComplaintDate(LocalDateTime.of(entry.getKey(), LocalTime.NOON));
        List<AllegationDto> allegations = entry.getValue().stream()
                .map(CountyLicenseCaseComplaintInfo::toAllegationDto).collect(Collectors.toList());
        complaintDto.setAllegations(allegations);
        complaints.add(complaintDto);//  w w  w . j av  a 2 s . c o m
    }
    return complaints;
}