Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners How to get the current date in Java?

Have Programming Question? Ask it here!
 
 
 


Java Coder
How to get the current date in Java?
2 Answer(s)      6 months and 20 days 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


Advertisement
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



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com