How to get current date and time in java

Tutorials Shared by the Internet Community

Advertisements


Synopsis

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

Statistics

  • Total Hits - 27033

  • Total Votes - 325 votes

  • Vote Up - 180 votes

  • Vote Down - 145 votes

  • Domain - beginnersbook.com

  • Category - JAVA/Core JAVA

  • Submitted By - Chaitanya

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

Description

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


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

Advertisements