How to compose date Java code

I would like to learn how to compose date Java code so that I can display the date and time in a Java program.
Please help me how doing it.

I would like to learn how to compose date Java code so that I can display the date and time in a Java program.
Please help me how doing it.
Hi,
You can use this example to compose dates in Java.
Enclose them in the date parenthesis.
I have attached them.
Hello,
Here is a piece of code for you.
Hi,
Java gives the Date class available in java.util package. This class displays the current date and time.
The Date class supports two constructors. The first constructor initializes the object with the current date and time.
Date( )
The constructor below accepts one argument that equals the number of milliseconds that have elapsed since midnight, January 1, 1970.
Date (long millisec).
Use the following code to display date and time using Java program.
Import java.util.Date; public class DateDemo { public static void main(String args[]) { // Instantiate a Date object Date date = new Date(); // display time and date using toString() System.out.println(date.toString()); } }
Thanks,