本文整理匯總了Java中java.time.ZonedDateTime.withEarlierOffsetAtOverlap方法的典型用法代碼示例。如果您正苦於以下問題:Java ZonedDateTime.withEarlierOffsetAtOverlap方法的具體用法?Java ZonedDateTime.withEarlierOffsetAtOverlap怎麽用?Java ZonedDateTime.withEarlierOffsetAtOverlap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.time.ZonedDateTime
的用法示例。
在下文中一共展示了ZonedDateTime.withEarlierOffsetAtOverlap方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test_withEarlierOffsetAtOverlap_atOverlap
import java.time.ZonedDateTime; //導入方法依賴的package包/類
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap() {
ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0100, ZONE_PARIS);
ZonedDateTime test = base.withEarlierOffsetAtOverlap();
assertEquals(test.getOffset(), OFFSET_0200); // offset changed to earlier
assertEquals(test.toLocalDateTime(), base.toLocalDateTime()); // date-time not changed
}
示例2: test_withEarlierOffsetAtOverlap_notAtOverlap
import java.time.ZonedDateTime; //導入方法依賴的package包/類
@Test
public void test_withEarlierOffsetAtOverlap_notAtOverlap() {
ZonedDateTime base = ZonedDateTime.ofStrict(TEST_LOCAL_2008_06_30_11_30_59_500, OFFSET_0200, ZONE_PARIS);
ZonedDateTime test = base.withEarlierOffsetAtOverlap();
assertEquals(test, base); // not changed
}
示例3: test_withEarlierOffsetAtOverlap_atOverlap_noChange
import java.time.ZonedDateTime; //導入方法依賴的package包/類
@Test
public void test_withEarlierOffsetAtOverlap_atOverlap_noChange() {
ZonedDateTime base = ZonedDateTime.ofStrict(TEST_PARIS_OVERLAP_2008_10_26_02_30, OFFSET_0200, ZONE_PARIS);
ZonedDateTime test = base.withEarlierOffsetAtOverlap();
assertEquals(test, base); // not changed
}