我正在使用 java 代码创建会议请求并将其发送到完整版和精简版的 Outlook,如下所示:
final SimpleDateFormat iCalendarDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmm'00'");
final long uid =System.currentTimeMillis();
iCalendarDateFormat.setTimeZone(TimeZone.getTimeZone(MRBSConstants.TIMEZONE));
final String calendarContent = "BEGIN:VCALENDAR\n"
+ "METHOD:REQUEST\n"
+ "PRODID: BCP - Meeting\n"
+ "VERSION:2.0\n"
+ "BEGIN:VEVENT\n"
+ "DTSTAMP:"+ iCalendarDateFormat.format(meetingEndTime) + "\n"
+ "DTSTART:" + iCalendarDateFormat.format(meetingStartTime) + "\n"
+ "DTEND:"+ iCalendarDateFormat.format(meetingEndTime) + "\n"
+ "SUMMARY:test request\n"
+ "UID:" + uid + "\n"
+ "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:" + Arrays.toString(recipetList) + "\n"
+ "ORGANIZER:MAILTO:" + from+ "\n"
+ "LOCATION:" +loc + "\n"
+ "DESCRIPTION:" + body+ "\n"
+ "SEQUENCE:0\n" + "PRIORITY:5\n" + "CLASS:PUBLIC\n" + "STATUS:CONFIRMED\n" + "TRANSP:OPAQUE\n" + "BEGIN:VALARM\n"
+ "ACTION:DISPLAY\n" + "DESCRIPTION:REMINDER\n" + "TRIGGER;RELATED=START:-PT00H15M00S\n" + "END:VALARM\n" + "END:VEVENT\n" + "END:VCALENDAR";
它在精简版的 Outlook 中运行良好意味着它在精简版中给出正确的时间,但在完整版的 Outlook 中显示不同的时间。为什么
这里MRBSConstants.TIMEZONE值为GMT-5:30。
我也尝试添加VTIMEZONE COMPONENT但在这种情况下 Outlook 无法识别 ics 文件是正确的。
我们是否有任何通用的 ics 对象可以在这两个版本上工作?