Example usage for java.time LocalDateTime withSecond

List of usage examples for java.time LocalDateTime withSecond

Introduction

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

Prototype

public LocalDateTime withSecond(int second) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01);

    LocalDateTime t = a.withSecond(1234);

    System.out.println(t);/*from   w w w.j av  a2  s. com*/
}