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?
how to get current date without system date
Advertisements
Java current date - How to get current date in Java
How can we get second of the current time using date function?
JDBC: Get current Date and Time Example
Java program to get current date
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?
Getting Previous, Current and Next Day Date
How to get current logged in Windows username? - Struts
difference between java5 and java6 - Java Beginners
how to display(update) current date and month in select box on selecting the year.
Java2
Current Date iPhone SDK
JSP:How to get year of system date - Date Calendar
How many ways can we get the value of current session id?
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.
Current date in php
How to convert current date to mm dd yyyy format in Java?
How to get day from date in SQL?
Mysql Date Get Year
Iphone Current Date Application
current date in php
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?

Ads