Date currentDate = new Date(); System.out.println(currentDate);
Date specificDate = new Date(121, 8, 1, 12, 30, 0); System.out.println(specificDate);
Date currentDate = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); String formattedDate = dateFormat.format(currentDate); System.out.println(formattedDate);Output: 01-09-2021 12:23:45 This class belongs to the java.util package library.