Example usage for java.time OffsetDateTime withHour

List of usage examples for java.time OffsetDateTime withHour

Introduction

In this page you can find the example usage for java.time OffsetDateTime withHour.

Prototype

public OffsetDateTime withHour(int hour) 

Source Link

Document

Returns a copy of this OffsetDateTime with the hour-of-day altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withHour(4);
    System.out.println(d);//from www .ja  v  a 2s . c  o m
}