/* TZ code will always be set to "MEZ-1MESZ,M3.5.0,M10.5.0". *ThisensuresthetransitionperiodsforDaylightsSavingsshouldbeatMarch'slast *SundayandOctober'slastSunday.
*/ privatestaticvoid runTZTest() {
Date time = new Date(); if (new SimpleTimeZone(3600000, "MEZ-1MESZ", Calendar.MARCH, -1, Calendar.SUNDAY, 0,
Calendar.OCTOBER, -1, Calendar.SUNDAY, 0).inDaylightTime(time)) { // We are in Daylight savings period. if (time.toString().endsWith("GMT+02:00 " + Integer.toString(time.getYear() + 1900))) return;
} else { if (time.toString().endsWith("GMT+01:00 " + Integer.toString(time.getYear() + 1900))) return;
}
// Reaching here means time zone did not match up as expected. thrownew RuntimeException("Got unexpected timezone information: " + time);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.