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 に答える