LocalDateTime of(int year, int 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.
of
has the following syntax.
public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
The following example shows how to use of
.
import java.time.LocalDateTime; public class Main { public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014,12,21,10,20,30,200); System.out.println(a); } }
The code above generates the following result.