森栏
我在两个不同的结果中得到了“1000-01-01 00:00:00”的时间戳。有人知道为什么吗?TimeZone timeZone = TimeZone.getTimeZone(ZoneOffset.UTC);GregorianCalendar calendar = new GregorianCalendar(timeZone);calendar.clear();calendar.set(1000, 0, 1, 0, 0, 0);System.out.println(calendar.getTimeInMillis()); // print -30609792000000System.out.println(ZonedDateTime.of(1000, 1, 1,0, 0, 0, 0, timeZone.toZoneId()).toInstant().toEpochMilli()); // print -30610224000000