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