Hi,
I am new to Java and trying to write a program to get the current date. How to get the current date in Java?
Thanks
Hi,
To get the current date and time in Java you can use the following code:
Calendar currentDate = Calendar.getInstance();
and with the help of Formatter class you can format the date.
Check the tutorial: Java program to get current date.
Thanks
Ads