Java Code Examples for java.time.ZoneOffset#adjustInto()
The following examples show how to use
java.time.ZoneOffset#adjustInto() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKZoneOffset.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_OffsetDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (int i=-18; i<=18; i++) { OffsetDateTime offsetDateTime_target = OffsetDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneOffset.ofHours(i)); OffsetDateTime offsetDateTime_result = (OffsetDateTime)base.adjustInto(offsetDateTime_target); assertEquals(base, offsetDateTime_result.getOffset()); //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = offsetDateTime_target.toZonedDateTime(); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); } }
Example 2
Source File: TCKZoneOffset.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_OffsetDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (int i=-18; i<=18; i++) { OffsetDateTime offsetDateTime_target = OffsetDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneOffset.ofHours(i)); OffsetDateTime offsetDateTime_result = (OffsetDateTime)base.adjustInto(offsetDateTime_target); assertEquals(base, offsetDateTime_result.getOffset()); //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = offsetDateTime_target.toZonedDateTime(); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); } }
Example 3
Source File: TCKZoneOffset.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_ZonedDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (String zoneId : ZoneId.getAvailableZoneIds()) { //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = ZonedDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneId.of(zoneId)); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); OffsetDateTime offsetDateTime_target = zonedDateTime_target.toOffsetDateTime(); OffsetDateTime offsetDateTime_result = (OffsetDateTime)(base.adjustInto(offsetDateTime_target)); assertEquals(base, offsetDateTime_result.getOffset()); } }
Example 4
Source File: TCKZoneOffset.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_ZonedDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (String zoneId : ZoneId.getAvailableZoneIds()) { //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = ZonedDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneId.of(zoneId)); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); OffsetDateTime offsetDateTime_target = zonedDateTime_target.toOffsetDateTime(); OffsetDateTime offsetDateTime_result = (OffsetDateTime)(base.adjustInto(offsetDateTime_target)); assertEquals(base, offsetDateTime_result.getOffset()); } }
Example 5
Source File: TCKZoneOffset.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_ZonedDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (String zoneId : ZoneId.getAvailableZoneIds()) { //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = ZonedDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneId.of(zoneId)); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); OffsetDateTime offsetDateTime_target = zonedDateTime_target.toOffsetDateTime(); OffsetDateTime offsetDateTime_result = (OffsetDateTime)(base.adjustInto(offsetDateTime_target)); assertEquals(base, offsetDateTime_result.getOffset()); } }
Example 6
Source File: TCKZoneOffset.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_ZonedDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (String zoneId : ZoneId.getAvailableZoneIds()) { //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = ZonedDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneId.of(zoneId)); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); OffsetDateTime offsetDateTime_target = zonedDateTime_target.toOffsetDateTime(); OffsetDateTime offsetDateTime_result = (OffsetDateTime)(base.adjustInto(offsetDateTime_target)); assertEquals(base, offsetDateTime_result.getOffset()); } }
Example 7
Source File: TCKZoneOffset.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_OffsetDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (int i=-18; i<=18; i++) { OffsetDateTime offsetDateTime_target = OffsetDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneOffset.ofHours(i)); OffsetDateTime offsetDateTime_result = (OffsetDateTime)base.adjustInto(offsetDateTime_target); assertEquals(base, offsetDateTime_result.getOffset()); //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = offsetDateTime_target.toZonedDateTime(); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); } }
Example 8
Source File: TCKZoneOffset.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_ZonedDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (String zoneId : ZoneId.getAvailableZoneIds()) { //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = ZonedDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneId.of(zoneId)); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); OffsetDateTime offsetDateTime_target = zonedDateTime_target.toOffsetDateTime(); OffsetDateTime offsetDateTime_result = (OffsetDateTime)(base.adjustInto(offsetDateTime_target)); assertEquals(base, offsetDateTime_result.getOffset()); } }
Example 9
Source File: TCKZoneOffset.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_OffsetDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (int i=-18; i<=18; i++) { OffsetDateTime offsetDateTime_target = OffsetDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneOffset.ofHours(i)); OffsetDateTime offsetDateTime_result = (OffsetDateTime)base.adjustInto(offsetDateTime_target); assertEquals(base, offsetDateTime_result.getOffset()); //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = offsetDateTime_target.toZonedDateTime(); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); } }
Example 10
Source File: TCKZoneOffset.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test public void test_adjustInto_OffsetDateTime() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); for (int i=-18; i<=18; i++) { OffsetDateTime offsetDateTime_target = OffsetDateTime.of(LocalDate.of(1909, 2, 2), LocalTime.of(10, 10, 10), ZoneOffset.ofHours(i)); OffsetDateTime offsetDateTime_result = (OffsetDateTime)base.adjustInto(offsetDateTime_target); assertEquals(base, offsetDateTime_result.getOffset()); //Do not change offset of ZonedDateTime after adjustInto() ZonedDateTime zonedDateTime_target = offsetDateTime_target.toZonedDateTime(); ZonedDateTime zonedDateTime_result = (ZonedDateTime)(base.adjustInto(zonedDateTime_target)); assertEquals(zonedDateTime_target.getOffset(), zonedDateTime_result.getOffset()); } }
Example 11
Source File: TCKZoneOffset.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 12
Source File: TCKZoneOffset.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 13
Source File: TCKZoneOffset.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 14
Source File: TCKZoneOffset.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 15
Source File: TCKZoneOffset.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 16
Source File: TCKZoneOffset.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 17
Source File: TCKZoneOffset.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 18
Source File: TCKZoneOffset.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 19
Source File: TCKZoneOffset.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }
Example 20
Source File: TCKZoneOffset.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=DateTimeException.class) public void test_adjustInto_dateOnly() { ZoneOffset base = ZoneOffset.ofHoursMinutesSeconds(1, 1, 1); base.adjustInto((LocalDate.of(1909, 2, 2))); }