Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

How to get the current date in Java?

Ads

 
 

Share on Google+Share on Google+

Java Coder
How to get the current date in Java?
2 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners

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

Ads
View Answers

January 5, 2014 at 11:35 AM


Hi,

Check the tutorial: Java program to get current date.

Thanks



January 5, 2014 at 11:42 AM


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