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

走远了吗. 提交于 2019-12-18 12:42:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!