2013-02-25 41 views
1

我有一個像組串日曆類型

Customer_Todo_Master customerTodo=new Customer_Todo_Master(); 
customerTodo.setCALCDATE(String type); 

這裏setCALCDATE代碼是日曆類型。我如何設置一個字符串到這個setCALCDATE()?使用SimpleDateFormat

回答

3

String str="your string rep of cal"; 
Calendar cal = Calendar.getInstance(); 
cal.setTime(new SimpleDateFormat("your date format").parse(str)); 
customerTodo.setCALCDATE(cal);