本文整理汇总了Java中java.util.SimpleTimeZone.setStartYear方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleTimeZone.setStartYear方法的具体用法?Java SimpleTimeZone.setStartYear怎么用?Java SimpleTimeZone.setStartYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.SimpleTimeZone
的用法示例。
在下文中一共展示了SimpleTimeZone.setStartYear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_setStartYearI
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* @tests java.util.SimpleTimeZone#setStartYear(int)
*/
public void test_setStartYearI() {
// Test for method void java.util.SimpleTimeZone.setStartYear(int)
SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
st.setStartYear(1999);
assertTrue("set year improperly set1", !(st
.inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
.getTime())));
assertTrue("set year improperly set2", !(st
.inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
13).getTime())));
assertTrue("set year improperly set3", (st
.inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
13).getTime())));
}
示例2: test_setStartYearI
import java.util.SimpleTimeZone; //导入方法依赖的package包/类
/**
* @tests java.util.SimpleTimeZone#setStartYear(int)
*/
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "setStartYear",
args = {int.class}
)
public void test_setStartYearI() {
// Test for method void java.util.SimpleTimeZone.setStartYear(int)
SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
st.setStartRule(Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0);
st.setEndRule(Calendar.NOVEMBER, -1, Calendar.SUNDAY, 0);
st.setStartYear(1999);
assertTrue("set year improperly set1", !(st
.inDaylightTime(new GregorianCalendar(1999, Calendar.JULY, 12)
.getTime())));
assertTrue("set year improperly set2", !(st
.inDaylightTime(new GregorianCalendar(1998, Calendar.OCTOBER,
13).getTime())));
assertTrue("set year improperly set3", (st
.inDaylightTime(new GregorianCalendar(1999, Calendar.NOVEMBER,
13).getTime())));
}
示例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();
}