Java Example | Get the Current Date and Time

This java example code will show us how to get the current date and time in java.

import java.util.Date;
public class CreateDate {
   public static void main(String args[]) {      
      Date date = new Date();
      System.out.print(date);
   }
}