Example usage for java.time OffsetDateTime withNano

List of usage examples for java.time OffsetDateTime withNano

Introduction

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

Prototype

public OffsetDateTime withNano(int nanoOfSecond) 

Source Link

Document

Returns a copy of this OffsetDateTime with the nano-of-second altered.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withNano(1234);
    System.out.println(d);/*  w ww  . java2s  .  c  o m*/
}