是否可以使用 Java Calendar/Date/TimeZone API 获取上一个和下一个 DST 转换时间戳?
我Joda-Time
可以写:
DateMidnight today = new DateMidnight(2009, 2, 24);
DateTimeZone zone = today.getZone();
DateTime previousTransition =
new DateTime(zone.previousTransition(today.getMillis()));
// 2008-10-26T02:59:59.999+02:00 for Europe/Berlin
System.out.println(previousTransition);
DateTime nextTransition =
new DateTime(zone.nextTransition(today.getMillis()));
// 2009-03-29T03:00:00.000+02:00 for Europe/Berlin
System.out.println(nextTransition);
有没有办法使用标准的 Java API 来做到这一点?