How to get current date and time in java

Tutorials Shared by the Internet Community


How to get current date and time in java

Java program to fetch the current date and current time from the system


  • Total Hits - 34040

  • Total Votes - 327 votes

  • Vote Up - 181 votes

  • Vote Down - 146 votes

  • Domain -

  • Category - JAVA/Core JAVA

  • Submitted By - Chaitanya

  • Submitted on - 2014-01-03 20:58:52


In this tutorial I have explained the ways to get current date/time in java with example programs. Java has the Date class available in java.util package, this class encapsulates the current date and time. We will use this class in our program along with SimpleDateFormat to fetch the date/time in desired format.    More detail...

Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down