I am using Nebulla DateChooserCombo. I have used it as dateChooserFrom.getText();. It is Producing the result like 7/31/2011 which is in m/dd/yyyy and mm/dd/yyyy format. I need the result in yyyy/mm/dd format. For that I have use the code as.
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String s = df.format(dateChooserFrom.getText());
But when I run the code it says Cannot format given Object as a Date . so please anybody could help me on this. I am using eclipse rcp and java.
Convert the String to Date first.