By Gurpreet Singh, Department of Computer Science & Engineering, Amritsar College of Engineering & Technology
Monday, 6 July 2015
Sunday, 5 July 2015
Get Current Date in java
To get current date in java write following code:
DateFormat dateFormat=new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date=new Date(); //get current date and time
System.out.println(""+dateFormat.format(date));
Import statements:
import java.text.*;
Subscribe to:
Posts (Atom)