The time format used in the .ics file?

I am creating a .ics file in Java and I need to know which date and time format to use.

Here is the current format of my ics file:

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART:20120901T180000
DTEND:20120901T183000
SUMMARY:my birthday
LOCATION:Bangalore
DESCRIPTION:Every one is welcome..!! time to party
PRIORITY:3
END:VEVENT
END:VCALENDAR

I used ISO_DATETIME_TIME_ZONE_FORMATto convert my date to the required format, but returned2012-09-01T18:00:00+00:00

What is the date format used in DTSTARTand values DTEND? In particular, how can I format this correctly in Java?

+5
source share
2 answers

Using Java you can use

DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss");

Learn more at iCalendar RFC 5545

+11
source

Do you have any caveats using a third-party library that will simplify this? If not, see ICal4j

0

All Articles