Example usage for java.time OffsetDateTime withSecond

List of usage examples for java.time OffsetDateTime withSecond

Introduction

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

Prototype

public OffsetDateTime withSecond(int second) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetDateTime o = OffsetDateTime.now();
    OffsetDateTime d = o.withSecond(34);
    System.out.println(d);/*w ww  .  j  a v a  2s  . c o  m*/
}