我有像
这样的代码Customer_Todo_Master customerTodo=new Customer_Todo_Master();
customerTodo.setCALCDATE(String type);
此处setCALCDATE
是日历类型。如何将字符串设置为此setCALCDATE()
?
答案 0 :(得分:3)
使用SimpleDateFormat类:
String str="your string rep of cal";
Calendar cal = Calendar.getInstance();
cal.setTime(new SimpleDateFormat("your date format").parse(str));
customerTodo.setCALCDATE(cal);