1
DateTimeZone
과 함께 DateTime
의 시간을 확인하는 기본 제공 방법이 있습니까?Joda Time 일광 절약 시간 탐지
작은 유틸리티 클래스를 작성했지만 기본 제공 방법을 선호합니다.
public class Dst {
public static long dayHours(DateTime instant) {
Period day = new Period(0, 0, 0, 1, 0, 0, 0, 0);
return new Duration(instant, instant.plus(day)).getStandardHours();
}
public static boolean hasClockChange(DateTime instant) {
return 24l != Dst.dayHours(instant);
}
}