Example usage for java.time OffsetTime with

List of usage examples for java.time OffsetTime with

Introduction

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

Prototype

@Override
public OffsetTime 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) {
    OffsetTime m = OffsetTime.now();
    OffsetTime n = m.with(ChronoField.HOUR_OF_DAY, 4);
    System.out.println(n);// w  w w  . jav  a 2 s .com

}