How to get current date and time in java

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

How to get current date and time in java

Java program to fetch the current date and current time from the system
  • Total Hits: 37149

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 421 votes

  • Category: JAVA/Core JAVA

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

  • Submitted By: Chaitanya

  • Set as Favorite


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...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 33.73%  142
 Two starsTwo star  Vote LeftVote MiddleVote Right 5.46%  23
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 9.5%  40
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 9.03%  38
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 42.28%  178

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.