new Date()
/* * Output: Tue Apr 25 13:25:27 PDT 2006 Wed Dec 31 16:00:00 PST 1969 */ import java.util.Date; public class MainClass { public static void main(String args[]) { Date currentDate = new Date(); System.out.println(currentDate); // Get date object initialized to the epoch (Jan 1 1970) Date epoch = new Date(0); System.out.println(epoch); } }