本文整理汇总了Java中java.util.SimpleTimeZone.inDaylightTime方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleTimeZone.inDaylightTime方法的具体用法?Java SimpleTimeZone.inDaylightTime怎么用?Java SimpleTimeZone.inDaylightTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.SimpleTimeZone
的用法示例。
在下文中一共展示了SimpleTimeZone.inDaylightTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inDaylightTime
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* Queries if the specified date is in Daylight Saving Time.
*/
public boolean inDaylightTime(Date date) {
if (date == null) {
throw new NullPointerException();
}
if (transitions == null) {
return false;
}
long utc = date.getTime() - rawOffsetDiff;
int index = getTransitionIndex(utc, UTC_TIME);
// before transitions in the transition table
if (index < 0) {
return false;
}
// the time is in the table range.
if (index < transitions.length) {
return (transitions[index] & DST_MASK) != 0;
}
// beyond the transition table
SimpleTimeZone tz = getLastRule();
if (tz != null) {
return tz.inDaylightTime(date);
}
return false;
}
示例2: inDaylightTime
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* Queries if the specified date is in Daylight Saving Time.
*/
public boolean inDaylightTime(Date date) {
if (date == null) {
throw new NullPointerException();
}
if (transitions == null) {
return false;
}
long utc = date.getTime() - rawOffsetDiff;
int index = getTransitionIndex(utc, UTC_TIME);
// before transitions in the transition table
if (index < 0) {
return false;
}
// the time is in the table range.
if (index < transitions.length) {
return (transitions[index] & DST_MASK) != 0;
}
// beyond the transition table
SimpleTimeZone tz = getLastRule();
if (tz != null) {
return tz.inDaylightTime(date);
}
return false;
}
示例3: test_clone_SimpleTimeZone
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
public void test_clone_SimpleTimeZone() {
SimpleTimeZone stz = new SimpleTimeZone(21600000, "Central Standard Time");
stz.setStartYear(1000);
stz.inDaylightTime(new Date());
stz.clone();
}