Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java program : need current Date in YYYY-MM-DD format without time in Date datatype [closed]

I need Date with only yyyy-mm-dd format, because DB2 table having 10 precision of date column.

like image 274
Vinayak Avatar asked Sep 11 '25 02:09

Vinayak


1 Answers

Date date = new Date();
String modifiedDate= new SimpleDateFormat("yyyy-MM-dd").format(date);

This will do.

like image 110
Shreyos Adikari Avatar answered Sep 13 '25 16:09

Shreyos Adikari