开发者

Unparseable date in java

I'm using java studio creator to build my application. I used the ajax component, Popup Calendar, and when I want to get the date and compare it with another date , I cann't :(. This is my code :

/开发者_如何学JAVA/ My Code

  SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");

  java.util.Calendar startDate = java.util.Calendar.getInstance(); 
  startDate.setTime(dateFormat.parse(startField.getValue().toString()));   
//

Where startField is the calendar..

I tried to set the dateformattedpattern in the properties of the calendar to be the same as dataformat but it gave an exception.

Is there any suggestions to fix the problem?


startField.getValue().toString() should be of the form yyyy/MM/dd

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜