我正在处理再次发生并使用 google-rfc-2445 库
此时我已经尝试了许多不同的方法,似乎我的 DateTime 变量格式不正确,我不确定发生了什么。
输出看起来像这样2015-05-05T17:11:11.000-05:00
在数据库中看起来像这样2015-05-05 22:11:11.0
我得到的错误看起来像这样
java.text.ParseException: cannot parse [[DTSTART=20150505T221111Z]] in [RRULE, recur]
我试过格式化输出但没有运气。
Date d = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
try{
d = df.parse(event.getDtStart().toString());
DateIterator date = DateIteratorFactory.createDateIterator("RRULE:" + event.getrRule(), d, TimeZone.getTimeZone(event.getTimeZone()), true);
} catch (ParseException e) {
e.printStackTrace();
}
我认为问题是我的 DTStart 格式不正确,但老实说,此时我不知道。它的格式很奇怪。
建议?