Java code to get current system Date and Time.
This code snippet will get current system date and time in Java.
Package to be used:java.util.Date;
Class to get current system date and time:Date
Java Code Snippet - Get current System Date and Time
import java.util.Date;
public class GetSystemDateTimePrg
{
public static void main(String args[])
{
Date dt=new Date();
System.out.print("dt.toString());
}
}
Mon Jun 20 20:56:09 IST 2016