LocalDateTime of(int year, Month month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond) example
Description
LocalDateTime of(int year, Month month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
gets an instance of LocalDateTime from year, month, day, hour, minute, second and nanosecond.
Syntax
of
has the following syntax.
public static LocalDateTime of(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int nanoOfSecond)
Example
The following example shows how to use of
.
import java.time.LocalDateTime;
import java.time.Month;
//from w w w. j av a 2s . c o m
public class Main {
public static void main(String[] args) {
LocalDateTime a = LocalDateTime.of(2014,Month.MARCH,21,10,20,123);
System.out.println(a);
}
}