use of net.fortuna.ical4j.model.property.DtStart in project zm-mailbox by Zimbra.
the class TZRule method getDtStart.
/**
* From initial TNEF to iCalendar Spec.
* The DTSTART property can be hard-coded to 16010101T000000. This is a value that
* works well across many calendar client apps.
* Note: Some examples seen are similar to this but include the hour of the transition.
* Suspect that is useful - so including it.
* Zimbra replaces our timezones with closest matchin known ones, so not worth trying
* to improve this to see if can choose an accurate start date/time in 1601.
*
* @param hr
* @param min
* @return
*/
private DtStart getDtStart(int hr, int min) {
TimeZone utcZone = TimeZone.getTimeZone("UTC");
GregorianCalendar gc = new GregorianCalendar(1601, 0, /* zero based */
1, hr, min);
gc.setTimeZone(utcZone);
Date startDate = gc.getTime();
DateTime startDateTime = new DateTime(startDate);
return new DtStart(startDateTime);
}
Aggregations