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.*;
No comments:
Post a Comment