publicstaticvoid main(String args[]) throws Exception {
GregorianCalendar c = new GregorianCalendar();
DateFormat fmt = new SimpleDateFormat("EEEE, MMMM dd, yyyy G", Locale.US); long bigMillis = 300000000000000L;
try { // We check two things: // 1. That handling millis in the range of +/- bigMillis works. // bigMillis is a value that used to blow up. // 2. The round-trip format/parse works in these extreme areas.
c.setTime(new Date(-bigMillis));
String s = fmt.format(c.getTime());
Date d = fmt.parse(s); if (Math.abs(d.getTime() + bigMillis) >= ONE_DAY) { thrownew Exception(s + " != " + fmt.format(d));
}
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.