public class Main
public static void main(String args)
LocalDateTime current = LocalDateTime.now();
System.out.println("Date and Time" + current);
Date and Time 2015-09-29 T 10:26:01.205979
What is local date and time in java
Java Program to Display Current Date and Time
The Date class in Java is found in the java. util package and includes a number of methods for working with dates and times. The Cloneable, Serializable, and Comparable interfaces of Java are implemented by the Date class. Using this Display Current Date and Time in Java Programming.
A Java package is a collection of classes, interfaces, and sub-packages that are similar in nature. In Java, packages are divided into two types: built-in packages and user-defined packages. Many built-in packages are available, including java, lang, awt, javax, swing, net, io, util, sql, and so on.