converting date to string and back to date in java

前端 未结 5 2018
暗喜
暗喜 2020-12-21 23:14

In my program I am trying to convert the date to string to specified format and then back to date. I need the date to be in dd-MMM-yy format. So, I am converting the date to

5条回答
  •  无人及你
    2020-12-21 23:59

    How are you passing the date object in your query, if you are simply appending date in your query string why you need to convert your string date back to date object ? And If you are using prepared statement then you need not worry about the format. And as suggested above Date object does not hold any format information

提交回复
热议问题