Example usage for java.time LocalTime with

List of usage examples for java.time LocalTime with

Introduction

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

Prototype

@Override
public LocalTime with(TemporalAdjuster adjuster) 

Source Link

Document

Returns an adjusted copy of this time.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalTime l = LocalTime.now();
    LocalTime s = l.with(LocalTime.NOON);
    System.out.println(s);//  www  .j  a va2s. c  o  m
}

From source file:Main.java

public static void main(String[] args) {
    TemporalAdjuster temporalAdjuster = (Temporal t) -> t.plus(Period.ofDays(10));

    System.out.println(temporalAdjuster);

    TemporalAdjuster fourMinutesFromNow = temporal -> temporal.plus(4, ChronoUnit.MINUTES);

    LocalTime localTime1 = LocalTime.of(12, 0, 0);
    System.out.println(localTime1.with(temporal -> temporal.plus(4, ChronoUnit.MINUTES)));

    System.out.println(Instant.now().with(temporalAdjuster));

    LocalDate localDate1 = LocalDate.of(2013, 12, 13);
    System.out.println(localDate1.with(TemporalAdjusters.lastDayOfMonth()));

}