Problems using SimpleDateFormat

前端 未结 4 1107
死守一世寂寞
死守一世寂寞 2021-01-21 08:20

Apparently, I\'m missing something fundamental. I\'m having a problem with formatting the value of a jspinner. I\'ve tried a couple different ways and keep receiving an error, d

4条回答
  •  独厮守ぢ
    2021-01-21 09:11

    You should use

    String dosFrom = sdfDestination.format((Date) dateFrom.getValue());
    

    The problem is that dateFrom actually returns the selected date, and Date.toString() doesn't return the date in the format you use.

提交回复
热议问题