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(TemporalField field, long newValue) 

Source Link

Document

Returns a copy of this time with the specified field set to a new value.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalTime l = LocalTime.now();
    LocalTime s = l.with(ChronoField.HOUR_OF_DAY, 4);
    System.out.println(s);/*from   w ww. ja  va2s. c  o  m*/
}