// Java program to get current system
// date and time
//package to class Date class
import java.util.Date;
public class GetSystemDateTimePrg {
public static void main(String args[]) {
//creating object of Date class
Date dt = new Date();
//printing the date and time
System.out.print("Current system date and time is: " + dt.toString());
}
}
Output
Current system date and time is: Mon Jul 13 20:56:09 IST 2015
Consider the program:
Output