Lines Matching refs:Instant

32 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.MIN, Instant.MIN.getEpochSecond() - 100, SECONDS, 1);
83 cmp(Instant.MIN, Instant.MIN.getEpochSecond(), SECONDS, 0);
85 cmp(Instant.MAX, Long.MAX_VALUE, DAYS, -1);
86 cmp(Instant.MAX, Long.MAX_VALUE, HOURS, -1);
87 cmp(Instant.MAX, Long.MAX_VALUE, MINUTES, -1);
88 cmp(Instant.MAX, Long.MAX_VALUE, SECONDS, -1);
89 cmp(Instant.MAX, Instant.MAX.getEpochSecond() + 1, SECONDS, -1);
90 cmp(Instant.MAX, Instant.MAX.getEpochSecond() + 100, SECONDS, -1);
91 cmp(Instant.MAX, Instant.MAX.getEpochSecond(), SECONDS, 0);
122 Instant instant = ft.toInstant();
123 if (instant != Instant.MIN && instant != Instant.MAX) {
131 Instant instant = ft.toInstant();
134 } else if (!instant.equals(Instant.MIN)) {
142 } else if (!instant.equals(Instant.MAX)) {
147 // from(Instant)
152 Instant instant = Instant.ofEpochSecond(secs, rand.nextInt(1000_000_000));
155 throw new RuntimeException("from(Instant) failed");
158 instant = Instant.ofEpochMilli(millis);
162 throw new RuntimeException("from(Instant) failed");
168 instant = Instant.ofEpochSecond(secs, nanos);
170 throw new RuntimeException("from(Instant) failed");
205 ts(Instant.MIN, "-1000000001-01-01T00:00:00Z");
206 ts(Instant.MAX, "1000000000-12-31T23:59:59.999999999Z");
225 // Instant + toMilli() overflow
227 FileTime.from(Instant.MAX).toMillis());
229 FileTime.from(Instant.ofEpochSecond(Long.MAX_VALUE / 1000 + 1))
232 FileTime.from(Instant.MIN).toMillis());
234 FileTime.from(Instant.ofEpochSecond(Long.MIN_VALUE / 1000 - 1))
237 // Instant + to(TimeUnit) overflow
239 FileTime.from(Instant.ofEpochSecond(Long.MAX_VALUE / 1000 + 1))
242 FileTime.from(Instant.ofEpochSecond(Long.MAX_VALUE / 1000,
246 FileTime.from(Instant.ofEpochSecond(Long.MIN_VALUE / 1000 - 1))
249 FileTime.from(Instant.ofEpochSecond(Long.MIN_VALUE / 1000,
265 static void cmp(Instant ins, long v2, TimeUnit u2, int expected) {
280 static void eq(Instant ins, long v2, TimeUnit u2) {
289 static void eqTime(long value, TimeUnit unit, Instant instant) {
309 static void neq(Instant ins, long v2, TimeUnit u2) {
337 static void ts(Instant instant, String expected) {