1

我有一个类似的代码

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

setCALCDATE是一个日历类型。我怎样才能为此设置一个字符串setCALCDATE()

4

1 回答 1

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);
于 2013-02-25T14:50:18.867 回答