I am getting a parsing exception while I am trying the following code:
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import net.fortuna.ical4j.model.TimeZone;
import net.fortuna.ical4j.model.TimeZoneRegistry;
import net.fortuna.ical4j.model.TimeZoneRegistryFactory;
import net.fortuna.ical4j.model.property.DtStart;
public class Timezone {
public static void main(String[] args) {
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone tz;
LocalDateTime now = LocalDateTime.now();
Meeting meeting = new Meeting();
meeting.setDtStartLocal(now);
final DateTimeFormatter ICS_DATE_FORMATTER =
DateTimeFormatter.ofPattern("yyyyMMdd'T'HHmmss");
//tz = registry.getTimeZone("Asia/Calcutta");
tz = registry.getTimeZone("Australia/Lord_Howe");
DtStart dtstart;
try {
dtstart = new DtStart(now.format(ICS_DATE_FORMATTER),tz);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
--------------------------------------------
import java.time.LocalDateTime;
public class Meeting {
private String meetingId;
private LocalDateTime dtStartLocal;
public String getMeetingId() {
return meetingId;
}
public void setMeetingId(String meetingId) {
this.meetingId = meetingId;
}
public LocalDateTime getDtStartLocal() {
return dtStartLocal;
}
public void setDtStartLocal(LocalDateTime dtStartLocal) {
this.dtStartLocal = dtStartLocal;
}
}
java.text.ParseException: Unparseable date: "20221207T170935"
at java.base/java.text.DateFormat.parse(DateFormat.java:395)
at net.fortuna.ical4j.model.DateTime.setTime(DateTime.java:418)
at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:325)
at net.fortuna.ical4j.model.property.DateProperty.setValue(DateProperty.java:137)
at net.fortuna.ical4j.model.property.DtStart.<init>(DtStart.java:146)
at Timezone.main(Timezone.java:33)</init></init>
I have used ical4j 3.0.19 jar and their dependency jar .
Its working for all the timezone except for the timezone "Australia/Lord_Howe".
Its only fails with summer time (DST) for timezone "Australia/Lord_Howe".
I am expecting the Dtstart value as :
DTSTART;TZID=Australia/Lord_Howe:20221207T170935
Its working for all the timezone except for the timezone "Australia/Lord_Howe".That too its only fails with summer time (DST) for timezone "Australia/Lord_Howe".
Hi ,Could anyone please help me on tis
Hi, ical4j is now hosted on Github. If you can raise the issue in Github issues it would be much appreciated.
https://github.com/ical4j/ical4j/issues