I read out a recurring Calendar event. In this event there is a rrule (CalendarContract.Events.RRULE) which describes the recurring event. In it can be an “until” date which looks like the code snippset below. An example rrule could be:
FREQ=WEEKLY;UNTIL=20121115T180000Z;BYDAY=MO,TU,WE,TH,FR
My question is about the date format. I don’t know what “T” and “Z” means. Is it something with timezone?
String untilDate = "20121115T180000Z"
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
date = format.parse(untilDate);
EDIT:
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd'T'HHmmssZ");
The T and Z are literal letters, meaning there must be an actual T and Z in those respective positions.
In the date string, the T indicates that time follows (as opposed to date) and the Z indicates Zulu, or UTC (GMT) time.