imはweeknumberから曜日を作成し、曜日のみを作成します。これは私が正常にSimpleDateFormatでやったことがありますが、私はjodatimeとして保存したい、私は多くのことを試してみましたが、実際には何もしませんでした。SimpleDateFormatからJodaTimeを解析する
これは、これまでの私のコードです。
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.set(Calendar.WEEK_OF_YEAR, week_of_year);
cal.set(Calendar.DAY_OF_WEEK, day_of_week);
sdf.format(cal.getTime());
DateTimeFormatter dtf = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm:ss");
DateTime jodatime = dtf.parseDateTime(sdf.toString());
私は、自分のカレンダーかんたんの日付、時間に基づいてオブジェクトを並べ替えることを望んでいます。あなたは、単に動作しませんオブジェクトののtoStringを渡している
java.lang.IllegalArgumentException: Invalid format: "[email protected]"
at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945)
at com.example.casper.autimeplan.Fragments.ScheduleFragment$MyJavaScriptInterface.getBasicInfo(ScheduleFragment.java:282)
at com.example.casper.autimeplan.Fragments.ScheduleFragment$MyJavaScriptInterface.access$400(ScheduleFragment.java:186)
at com.example.casper.autimeplan.Fragments.ScheduleFragment$MyJavaScriptInterface$1.run(ScheduleFragment.java:203)