How to get the current date in Java?

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









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
Get current Date and Time
Java program to get current date
How to display current date in textbox - Date Calendar
How to get current timestamps in Java
convert current date into date format
difference between java5 and java6 - Java Beginners
Java2
javascript current date and time.
Current date in php
How to get system current cursor type
how to display(update) current date and month in select box on selecting the year.
Getting Previous, Current and Next Day Date
Iphone Current Date Application
current date in php
How to convert current date to dd mm yyyy format in Java?
How to format current date into yyyy-mm-dd in Java
How to convert current date to mm dd yyyy format in Java?
get current date in java in yyyy mm dd hh mm ss format
Current Date iPhone SDK
How to get current logged in Windows username? - Struts
current date set
about java1
JDBC : Current Date
Mysql Date Get Year
How to get max date in Hibernate?
How automatically calculate age based on date of birth and current date using jsp and servlet?
getting current date without using system date - Date Calendar
How many ways can we get the value of current session id?
Javah
JSP:How to get year of system date - Date Calendar
Iphone Show Current Date & Time
Insert current date into MYSQL database
Getting the current date
How to get yesterday date in Python?
c# current date in yyyy-MM-dd format
Java Get Month from Date
Get Date and Time
How to get day from date in SQL?
JDBC: Get current TimeStamp Example
Get current country from iPhone ??
date format to be updated with current date time
updated with current date n time
Get current working directory in Java
J2ME Current Date And Time
how to get date format in string from date object containing real date in java

Ads