how to get current date in java

82

get today date in java 8 -

LocalDate localDate = LocalDate.now();

how to get current date in java -

long millis=System.currentTimeMillis();  
java.sql.Date date=new java.sql.Date(millis);  
System.out.println(date);

Comments

Submit
0 Comments