Example usage for java.time LocalDateTime withNano

List of usage examples for java.time LocalDateTime withNano

Introduction

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

Prototype

public LocalDateTime withNano(int nanoOfSecond) 

Source Link

Document

Returns a copy of this LocalDateTime with the nano-of-second 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.withNano(1234);

    System.out.println(t);//from  w  w w.  j  a  va 2 s  .  co  m
}

From source file:org.darkware.wpman.agents.CronEvent.java

/**
 * Creates a new event associating the blog, hook, and execution time.
 *
 * @param blog The {@link WPBlog} the hook executes against.
 * @param hook The name of the hook to execute.
 * @param execTime The requested execution time of the hook.
 *//*from ww w  .  j  a v  a  2s.c  o m*/
public CronEvent(final WPBlog blog, final String hook, final LocalDateTime execTime) {
    super();

    this.blog = blog;
    this.hook = hook;
    this.execTime = execTime.withNano(0);
}