Searched refs:Instant (Results 1 - 25 of 102) sorted by relevance

12345

/openjdk9/nashorn/samples/
H A Dsecondssince.js38 var Instant = java.time.Instant;
41 var sec = Instant.parse(readLine()).
42 until(Instant.now(), ChronoUnit.SECONDS);
H A Ddateconversion.js39 var Instant = java.time.Instant; variable
50 // Java Instant.ofEpochMilli to convert time in milliseconds to Instant object
51 // https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#ofEpochMilli-long-
53 var instant = Instant.ofEpochMilli(d.getTime());
55 // Instant to LocalDateTime using LocalDateTime.ofInstant
56 // https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#ofInstant-java.time.Instant-java.time.ZoneId-
62 // convert LocalDateTime to Instant first
68 // https://docs.oracle.com/javase/8/docs/api/java/time/Instant
[all...]
H A Ddatetime.js39 var Instant = java.time.Instant; variable
50 // Java Instant.ofEpochMilli to convert time in milliseconds to Instant object
51 // https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html#ofEpochMilli-long-
53 var instant = Instant.ofEpochMilli(d.getTime());
55 // Instant to LocalDateTime using LocalDateTime.ofInstant
56 // https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html#ofInstant-java.time.Instant-java.time.ZoneId-
62 // convert LocalDateTime to Instant first
68 // https://docs.oracle.com/javase/8/docs/api/java/time/Instant
[all...]
H A Dimportstatic.js49 importStatic(java.time.Instant);
/openjdk9/jdk/test/java/time/tck/java/time/
H A DTCKInstant.java85 import java.time.Instant;
114 * Test Instant.
121 private static final long MIN_SECOND = Instant.MIN.getEpochSecond();
122 private static final long MAX_SECOND = Instant.MAX.getEpochSecond();
126 private Instant TEST_12345_123456789;
130 TEST_12345_123456789 = Instant.ofEpochSecond(12345, 123456789);
136 TemporalAccessor[] array = {TEST_12345_123456789, Instant.MIN, Instant.MAX, Instant.EPOCH};
162 private void check(Instant instan
[all...]
H A DTCKClock.java65 import java.time.Instant;
88 public Instant instant() {
89 return Instant.ofEpochMilli(millis());
113 private static final Instant INSTANT = Instant.ofEpochSecond(1873687, 357000000);
/openjdk9/jdk/src/java.base/share/classes/java/time/
H A DInstant.java192 * This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime},
199 * {@code Instant} may have unpredictable results and should be avoided.
207 public final class Instant class in inherits:Temporal,TemporalAdjuster,Comparable,Serializable
208 implements Temporal, TemporalAdjuster, Comparable<Instant>, Serializable {
213 public static final Instant EPOCH = new Instant(0, 0);
223 * The minimum supported {@code Instant}, '-1000000000-01-01T00:00Z'.
232 public static final Instant MIN = Instant.ofEpochSecond(MIN_SECOND, 0);
234 * The maximum supported {@code Instant}, '100000000
423 private Instant(long epochSecond, int nanos) { method in class:Instant
[all...]
H A DClock.java102 * This approach allows an alternate clock, such as {@link #fixed(Instant, ZoneId) fixed}
119 * as described in {@link Instant}. If the implementation wraps a source that provides leap
348 public static Clock fixed(Instant fixedInstant, ZoneId zone) {
420 * Most applications should avoid this method and use {@link Instant} to represent
444 public abstract Instant instant();
524 public Instant instant() {
558 return Instant.ofEpochSecond(localOffset, adjustment);
590 private final Instant instant;
593 FixedClock(Instant fixedInstant, ZoneId zone) {
613 public Instant instan
[all...]
/openjdk9/jdk/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/
H A DTimeoutEvent.java29 import java.time.Instant;
46 private final Instant deadline;
49 deadline = Instant.now().plus(duration);
54 public Instant deadline() {
/openjdk9/jdk/test/java/time/tck/java/time/serial/
H A DTCKInstantSerialization.java68 import java.time.Instant;
71 * Test Instant serialization.
79 assertSerializable(Instant.ofEpochMilli(134l));
91 assertSerializedBySer(Instant.ofEpochSecond(654321, 123456789), bytes);
96 assertNotSerializable(Instant.class);
H A DTCKClockSerialization.java66 import java.time.Instant;
87 private static final Instant INSTANT = ZDT.toInstant();
/openjdk9/jdk/test/java/time/test/java/time/
H A DTestInstant.java62 import java.time.Instant;
69 * Test Instant.
76 assertImmutable(Instant.class);
94 Instant t1 = Instant.ofEpochMilli(millis);
H A DTestOffsetDateTime_instants.java65 import java.time.Instant;
88 OffsetDateTime.ofInstant((Instant) null, OFFSET_PONE);
93 Instant instant = Instant.ofEpochSecond(0L);
99 Instant instant = Instant.ofEpochSecond(i);
114 Instant instant = Instant.ofEpochSecond(i * 24L * 60L * 60L);
135 Instant instant = Instant
[all...]
H A DTestClock_Fixed.java66 import java.time.Instant;
80 private static final Instant INSTANT = LocalDateTime.of(2008, 6, 30, 11, 30, 10, 500).atZone(ZoneOffset.ofHours(2)).toInstant();
H A DTestClock_System.java67 import java.time.Instant;
123 private static String formatTime(String prefix, Instant time) {
132 Instant start = Instant.ofEpochMilli(System.currentTimeMillis());
136 Instant system1 = Instant.ofEpochMilli(System.currentTimeMillis());
137 Instant system2 = Instant.ofEpochMilli(System.currentTimeMillis());
138 Instant highest1 = highestUTC.instant();
139 Instant highest
[all...]
/openjdk9/jdk/test/java/time/tck/java/time/format/
H A DTCKInstantPrinterParser.java66 import java.time.Instant;
105 {Instant.MAX.getEpochSecond(), 999999999, "+1000000000-12-31T23:59:59.999999999Z"},
106 {Instant.MIN.getEpochSecond(), 0, "-1000000000-01-01T00:00:00Z"},
112 Instant instant = Instant.ofEpochSecond(instantSecs, nano);
183 {9, Instant.MAX.getEpochSecond(), 999999999, "+1000000000-12-31T23:59:59.999999999Z"},
184 {9, Instant.MIN.getEpochSecond(), 0, "-1000000000-01-01T00:00:00.000000000Z"},
190 Instant instant = Instant.ofEpochSecond(instantSecs, nano);
219 {Instant
[all...]
/openjdk9/jdk/test/java/nio/file/attribute/FileTime/
H A DBasic.java32 import java.time.Instant;
47 Instant nowInstant = Instant.ofEpochMilli(now);
77 cmp(Instant.MIN, Long.MIN_VALUE, DAYS, 1);
78 cmp(Instant.MIN, Long.MIN_VALUE, HOURS, 1);
79 cmp(Instant.MIN, Long.MIN_VALUE, MINUTES, 1);
80 cmp(Instant.MIN, Long.MIN_VALUE, SECONDS, 1);
81 cmp(Instant.MIN, Instant.MIN.getEpochSecond() - 1, SECONDS, 1);
82 cmp(Instant
[all...]
/openjdk9/jdk/test/java/nio/file/attribute/BasicFileAttributeView/
H A DCreationTime.java34 import java.time.Instant;
64 Instant now = Instant.now();
92 Instant plusHour = Instant.now().plusSeconds(60L * 60L);
105 Instant minusHour = Instant.now().minusSeconds(60L * 60L);
/openjdk9/jdk/test/java/time/test/java/time/format/
H A DTestDateTimeParsing.java72 import java.time.Instant;
130 {INSTANTSECONDS_WITH_PARIS, "86402", Instant.ofEpochSecond(86402).atZone(PARIS)},
131 {INSTANTSECONDS_NOS_WITH_PARIS, "86402.123456789", Instant.ofEpochSecond(86402, 123456789).atZone(PARIS)},
132 {INSTANTSECONDS_OFFSETSECONDS, "86402 9000", Instant.ofEpochSecond(86402).atZone(OFFSET_0230)},
151 assertEquals(Instant.from(actual), expected.toInstant());
170 {INSTANTSECONDS, "86402", Instant.ofEpochSecond(86402)},
171 {INSTANTSECONDS_NOS, "86402.123456789", Instant.ofEpochSecond(86402, 123456789)},
176 public void test_parse_instantNoZone_ZDT(DateTimeFormatter formatter, String text, Instant expected) {
182 public void test_parse_instantNoZone_LDT(DateTimeFormatter formatter, String text, Instant expected) {
188 public void test_parse_instantNoZone_Instant(DateTimeFormatter formatter, String text, Instant expecte
[all...]
/openjdk9/jdk/test/java/util/logging/HigherResolutionTimeStamps/
H A DLogRecordWithNanosAPI.java28 import java.time.Instant;
120 ? Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
128 ? Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
164 final Instant instant = record.getInstant();
173 record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
178 assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
185 assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
191 record.setInstant(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
198 assertEquals(Instant.ofEpochSecond(millis/MILLIS_IN_SECOND,
207 assertEquals(Instant
[all...]
/openjdk9/jdk/test/java/util/Calendar/
H A DJavatimeTest.java31 import java.time.Instant;
60 Instant inst = Instant.ofEpochSecond(secs, nanos);
61 Instant inst_ms = Instant.ofEpochSecond(secs, nanos_ms);
64 Instant inst0 = jud.toInstant();
/openjdk9/jdk/src/java.base/share/classes/java/lang/
H A DProcessHandle.java28 import java.time.Instant;
265 * @return an {@code Optional<Instant>} of the start time of the process
267 public Optional<Instant> startInstant();
/openjdk9/jdk/test/sun/util/resources/cldr/
H A DBug8134384.java43 String date1 = Date.from(Instant.parse("2015-06-21T00:00:00.00Z")).toString();
48 String date2 = Date.from(Instant.parse("2015-12-22T00:00:00.00Z")).toString();
/openjdk9/jdk/test/java/time/test/java/time/zone/
H A DTestFixedZoneRules.java67 import java.time.Instant;
89 assertEquals(test.getOffset((Instant) null), OFFSET_PONE);
/openjdk9/jdk/test/java/lang/ProcessHandle/
H A DOnExitTest.java26 import java.time.Instant;
125 Instant endTimeout = Instant.now().plusSeconds(timeout);
130 Instant.now().isBefore(endTimeout));
141 Instant startTime = Instant.now();
145 Duration elapsed = Duration.between(startTime, Instant.now());

Completed in 157 milliseconds

12345