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
精彩评论