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

Ads