Searched defs:instant (Results 1 - 22 of 22) sorted by relevance

/libcore/luni/src/test/java/libcore/java/util/
H A DDateTest.java120 // This instant exactly corresponds to Long.MIN_VALUE msec because
136 private static void assertArithmeticOverflowDateFrom(Instant instant) { argument
138 Date.from(instant);
139 fail(instant + " should not have been convertible to Date");
166 Instant instant = date.toInstant();
167 assertEquals(date, Date.from(instant));
169 assertEquals(instant, Instant.ofEpochMilli(millis));
170 assertEquals("Millis should be a millions of nanos", 0, instant.getNano() % 1000000);
173 assertEquals(millis, instant.toEpochMilli());
/libcore/ojluni/src/test/java/time/tck/java/time/
H A DTCKClock.java88 public Instant instant() { method in class:TCKClock.MockInstantClock
120 assertEquals(MOCK_INSTANT.instant(), INSTANT);
129 assertEquals(MOCK_INSTANT.instant(), INSTANT);
H A DTCKInstant.java163 private void check(Instant instant, long epochSecs, int nos) { argument
164 assertEquals(instant.getEpochSecond(), epochSecs);
165 assertEquals(instant.getNano(), nos);
166 assertEquals(instant, instant);
167 assertEquals(instant.hashCode(), instant.hashCode());
1865 Instant instant = Instant.ofEpochSecond(i);
1866 OffsetDateTime test = instant.atOffset(ZoneOffset.ofHours(1));
1887 Instant instant
2147 test_toString(Instant instant, String expected) argument
2152 test_parse(Instant instant, String text) argument
2157 test_parseLowercase(Instant instant, String text) argument
[all...]
H A DTCKLocalDateTime.java309 Instant instant = Instant.ofEpochSecond(i).plusNanos(123456789L);
310 Clock clock = Clock.fixed(instant, ZoneOffset.UTC);
325 Instant instant = Instant.ofEpochSecond(i).plusNanos(123456789L);
326 Clock clock = Clock.fixed(instant.minusSeconds(OFFSET_PONE.getTotalSeconds()), OFFSET_PONE);
342 Instant instant = Instant.ofEpochSecond(i).plusNanos(123456789L);
343 Clock clock = Clock.fixed(instant, ZoneOffset.UTC);
774 public void factory_ofInstant(Instant instant, ZoneId zone, LocalDateTime expected) { argument
775 LocalDateTime test = LocalDateTime.ofInstant(instant, zone);
/libcore/ojluni/src/test/java/nio/file/attribute/
H A DFileTimeTest.java128 Instant instant = ft.toInstant();
129 if (instant != Instant.MIN && instant != Instant.MAX) {
130 eqTime(value, unit, instant);
137 Instant instant = ft.toInstant();
139 eqTime(value, unit, instant);
140 } else if (!instant.equals(Instant.MIN)) {
145 instant = ft.toInstant();
147 eqTime(value, unit, instant);
148 } else if (!instant
295 eqTime(long value, TimeUnit unit, Instant instant) argument
343 ts(Instant instant, String expected) argument
[all...]
/libcore/ojluni/src/test/java/time/test/java/util/
H A DTestFormatter.java108 Instant instant = zdt.toInstant();
118 cal.setTimeInMillis(instant.toEpochMilli());
127 testInstant(locale, instant, zdt, cal);
243 private void testInstant(Locale locale, Instant instant, argument
248 test(fmtStr, locale, expected, instant);
/libcore/ojluni/src/main/java/java/time/
H A DClock.java72 * A clock providing access to the current instant, date and time using a time-zone.
74 * Instances of this class are used to find the current instant, which can be
86 * that requires the current instant. A dependency injection framework is one
137 * Obtains a clock that returns the current instant using the best available
141 * you need the current instant without the date or time.
147 * Conversion from instant to date or time uses the {@linkplain ZoneOffset#UTC UTC time-zone}.
159 * Obtains a clock that returns the current instant using the best available
168 * The {@link #systemUTC() UTC clock} should be used when you need the current instant
182 * Obtains a clock that returns the current instant using best available
189 * Conversion from instant t
410 public abstract Instant instant(); method in class:Clock
470 public Instant instant() { method in class:Clock.SystemClock
497 private final Instant instant; field in class:Clock.FixedClock
520 public Instant instant() { method in class:Clock.FixedClock
570 public Instant instant() { method in class:Clock.OffsetClock
621 public Instant instant() { method in class:Clock.TickClock
[all...]
H A DOffsetTime.java194 final Instant now = clock.instant(); // called once
237 * This creates an offset time with the same instant as that specified.
239 * offset for each instant.
241 * The date component of the instant is dropped during the conversion.
242 * This means that the conversion can never fail due to the instant being
245 * @param instant the instant to create the time from, not null
249 public static OffsetTime ofInstant(Instant instant, ZoneId zone) { argument
250 Objects.requireNonNull(instant, "instant");
[all...]
H A DLocalDateTime.java114 * It cannot represent an instant on the time-line without additional information
205 final Instant now = clock.instant(); // called once
377 * This creates a local date-time based on the specified instant.
378 * First, the offset from UTC/Greenwich is obtained using the zone ID and instant,
379 * which is simple as there is only one valid offset for each instant.
380 * Then, the instant and offset are used to calculate the local date-time.
382 * @param instant the instant to create the date-time from, not null
387 public static LocalDateTime ofInstant(Instant instant, ZoneId zone) { argument
388 Objects.requireNonNull(instant, "instan
[all...]
H A DOffsetDateTime.java106 * {@code OffsetDateTime}, {@link java.time.ZonedDateTime} and {@link java.time.Instant} all store an instant
108 * {@code Instant} is the simplest, simply representing the instant.
109 * {@code OffsetDateTime} adds to the instant the offset from UTC/Greenwich, which allows
144 * based solely on the instant.
147 * only compares the underlying instant.
161 * The comparison is based on the instant.
240 final Instant now = clock.instant(); // called once
308 * This creates an offset date-time with the same instant as that specified.
310 * offset for each instant.
312 * @param instant th
317 ofInstant(Instant instant, ZoneId zone) argument
[all...]
H A DZonedDateTime.java107 * to the instant time-line of {@code Instant}.
113 * Obtaining the offset for an instant is simple, as there is exactly one valid
114 * offset for each instant. By contrast, obtaining the offset for a local date-time
128 * instant by obtaining the offset has the potential to be complicated.
145 * represents an instant, especially during a daylight savings overlap.
150 * The offset and local date-time are used to define an instant when necessary.
227 final Instant now = clock.instant(); // called once
240 * The local date-time is then resolved to a single instant on the time-line.
269 * The local date-time is resolved to a single instant on the time-line.
299 * The local date-time is resolved to a single instant o
400 ofInstant(Instant instant, ZoneId zone) argument
[all...]
/libcore/ojluni/src/main/java/java/time/chrono/
H A DMinguoChronology.java274 public ChronoZonedDateTime<MinguoDate> zonedDateTime(Instant instant, ZoneId zone) { argument
275 return (ChronoZonedDateTime<MinguoDate>)super.zonedDateTime(instant, zone);
H A DChronoZonedDateTimeImpl.java163 * Obtains an instance from an instant using the specified time-zone.
166 * @param instant the instant, not null
170 static ChronoZonedDateTimeImpl<?> ofInstant(Chronology chrono, Instant instant, ZoneId zone) { argument
172 ZoneOffset offset = rules.getOffset(instant);
174 LocalDateTime ldt = LocalDateTime.ofEpochSecond(instant.getEpochSecond(), instant.getNano(), offset);
182 * @param instant the instant to create the date-time from, not null
187 private ChronoZonedDateTimeImpl<D> create(Instant instant, ZoneI argument
[all...]
H A DChronology.java506 Instant instant = Instant.from(temporal);
507 return zonedDateTime(instant, zone);
521 * This obtains a zoned date-time with the same instant as that specified.
523 * @param instant the instant to create the date-time from, not null
528 default ChronoZonedDateTime<? extends ChronoLocalDate> zonedDateTime(Instant instant, ZoneId zone) { argument
529 return ChronoZonedDateTimeImpl.ofInstant(this, instant, zone);
H A DIsoChronology.java299 * @param instant the instant to create the date-time from, not null
305 public ZonedDateTime zonedDateTime(Instant instant, ZoneId zone) { argument
306 return ZonedDateTime.ofInstant(instant, zone);
H A DJapaneseChronology.java330 public ChronoZonedDateTime<JapaneseDate> zonedDateTime(Instant instant, ZoneId zone) { argument
331 return (ChronoZonedDateTime<JapaneseDate>)super.zonedDateTime(instant, zone);
H A DThaiBuddhistChronology.java310 public ChronoZonedDateTime<ThaiBuddhistDate> zonedDateTime(Instant instant, ZoneId zone) { argument
311 return (ChronoZonedDateTime<ThaiBuddhistDate>)super.zonedDateTime(instant, zone);
H A DHijrahChronology.java540 public ChronoZonedDateTime<HijrahDate> zonedDateTime(Instant instant, ZoneId zone) { argument
541 return (ChronoZonedDateTime<HijrahDate>) super.zonedDateTime(instant, zone);
/libcore/ojluni/src/main/java/java/nio/file/attribute/
H A DFileTime.java65 * The value as Instant (created lazily, if not from an instant)
67 private Instant instant; field in class:FileTime
77 private FileTime(long value, TimeUnit unit, Instant instant) { argument
80 this.instant = instant;
117 * @param instant
118 * the instant to convert
120 * as the provided instant
123 public static FileTime from(Instant instant) { argument
124 Objects.requireNonNull(instant, "instan
[all...]
/libcore/ojluni/src/main/java/java/time/zone/
H A DZoneRules.java469 * Gets the offset applicable at the specified instant in these rules.
471 * The mapping from an instant to an offset is simple, there is only
472 * one valid offset for each instant.
475 * @param instant the instant to find the offset for, not null, but null
479 public ZoneOffset getOffset(Instant instant) { argument
483 long epochSec = instant.getEpochSecond();
739 * Gets the standard offset for the specified instant in this zone.
746 * @param instant the instant t
750 getStandardOffset(Instant instant) argument
780 getDaylightSavings(Instant instant) argument
803 isDaylightSavings(Instant instant) argument
836 nextTransition(Instant instant) argument
883 previousTransition(Instant instant) argument
[all...]
/libcore/ojluni/src/main/java/java/util/
H A DDate.java44 * The class <code>Date</code> represents a specific instant
202 * it represents the instant at the start of the minute specified by
225 * it represents the instant at the start of the second specified
661 * year that contains or begins with the instant in time represented
697 * with the instant in time represented by this <tt>Date</tt> object.
746 * instant in time represented by this <tt>Date</tt> object, as
786 * the instant in time represented by this <tt>Date</tt> object,
803 * with the instant in time represented by this <tt>Date</tt>
931 * @return <code>true</code> if and only if the instant of time
933 * earlier than the instant represente
1373 from(Instant instant) argument
[all...]
H A DCalendar.java59 * for converting between a specific instant in time and a set of {@link
63 * week. An instant in time can be represented by a millisecond value that is
1024 * is to set the instant parameter to a millisecond offset from the <a
1027 * values. These two ways can't be mixed. Trying to set both the instant and
1030 * instant or field parameters.
1072 private long instant; field in class:Calendar.Builder
1076 // (COMPUTED is used to indicate that the instant has been set.)
1094 * Sets the instant parameter to the given {@code instant} value that is
1098 * @param instant
1106 setInstant(long instant) argument
1130 setInstant(Date instant) argument
[all...]

Completed in 5629 milliseconds