Java Code Examples for java.time.ZonedDateTime#withNano()
The following examples show how to use
java.time.ZonedDateTime#withNano() .
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: TCKZonedDateTime.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 2
Source File: TCKZonedDateTime.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 3
Source File: TCKZonedDateTime.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 4
Source File: TCKZonedDateTime.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 5
Source File: TCKZonedDateTime.java From hottub with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 6
Source File: TCKZonedDateTime.java From hottub with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 7
Source File: TCKZonedDateTime.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 8
Source File: TCKZonedDateTime.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 9
Source File: TCKZonedDateTime.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 10
Source File: TCKZonedDateTime.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 11
Source File: TCKZonedDateTime.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 12
Source File: TCKZonedDateTime.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 13
Source File: TCKZonedDateTime.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 14
Source File: TCKZonedDateTime.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 15
Source File: TCKZonedDateTime.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 16
Source File: TCKZonedDateTime.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 17
Source File: TCKZonedDateTime.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 18
Source File: TCKZonedDateTime.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_noChange() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(500); assertEquals(test, base); }
Example 19
Source File: TCKZonedDateTime.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
@Test public void test_withNanoOfSecond_normal() { ZonedDateTime base = ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500, ZONE_0100); ZonedDateTime test = base.withNano(15); assertEquals(test, ZonedDateTime.of(TEST_LOCAL_2008_06_30_11_30_59_500.withNano(15), ZONE_0100)); }
Example 20
Source File: PDTFactory.java From ph-commons with Apache License 2.0 | 3 votes |
/** * Get the passed date time but with micro and nanoseconds set to 0, so that * only the milliseconds part is present. This is helpful for XSD * serialization, where only milliseconds granularity is available. * * @param aODT * Source date time. May be <code>null</code>. * @return <code>null</code> if the parameter is <code>null</code>, the local * date time with microseconds and nanoseconds set to 0 otherwise. * @since 9.2.0 */ @Nullable public static ZonedDateTime getWithMillisOnly (@Nullable final ZonedDateTime aODT) { return aODT == null ? null : aODT.withNano (aODT.get (ChronoField.MILLI_OF_SECOND) * (int) CGlobal.NANOSECONDS_PER_MILLISECOND); }