How to get the current date in Java?

Ads
 

How to get the current date in Java?

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

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









Related Tutorials/Questions & Answers:
How to get the current date in Java?
Java current date - How to get current date in Java
Advertisements
JDBC: Get current Date and Time Example
How to get current timestamps in Java
Get current Date and Time
How to display current date in textbox - Date Calendar
convert current date into date format
How to get system current cursor type
How to get max date in Hibernate?
how to display(update) current date and month in select box on selecting the year.
How to convert current date to dd mm yyyy format in Java?
get current date in java in yyyy mm dd hh mm ss format
javascript current date and time.
How to convert current date to mm dd yyyy format in Java?
Mysql Date Get Year
How to get day from date in SQL?
Current date in php
Iphone Current Date Application
How automatically calculate age based on date of birth and current date using jsp and servlet?
How to get month name from date(like-25/06/2012) using java?
Mysql Date Select
Java2
how to get date format in string from date object containing real date in java
how to get date format in string from date object containing real date in java
Insert current date into MYSQL database
JDBC: Get current TimeStamp Example
JDBC : Current Date
current date set
Get current working directory in Java
How to get day from date in Java using Calendar?
How to print current time in r?

Ads