问题
I need Date with only yyyy-mm-dd format, because DB2 table having 10 precision of date column.
回答1:
Date date = new Date();
String modifiedDate= new SimpleDateFormat("yyyy-MM-dd").format(date);
This will do.
来源:https://stackoverflow.com/questions/16413019/java-program-need-current-date-in-yyyy-mm-dd-format-without-time-in-date-datat