Uses of Class
java.time.Instant
| Package | Description |
|---|---|
| java.lang |
Provides classes that are fundamental to the design of the Java
programming language.
|
| java.nio.file.attribute |
Interfaces and classes providing access to file and file system attributes.
|
| java.sql |
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
Java™ programming language.
|
| java.time |
The main API for dates, times, instants, and durations.
|
| java.time.chrono |
Generic API for calendar systems other than the default ISO.
|
| java.time.zone |
Support for time-zones and their rules.
|
| java.util |
Contains the collections framework, some internationalization support classes,
a service loader, properties, random number generation, string parsing
and scanning classes, base64 encoding and decoding, a bit array, and
several miscellaneous utility classes.
|
| java.util.logging |
Provides the classes and interfaces of
the Java™ 2 platform's core logging facilities.
|
| jdk.jfr |
This package provides classes to create events and control Flight Recorder.
|
| jdk.jfr.consumer |
This package contains classes for consuming Flight Recorder data.
|
-
Uses of Instant in java.lang
Methods in java.lang that return types with arguments of type Instant Modifier and Type Method Description Optional<Instant>ProcessHandle.Info. startInstant()Returns the start time of the process. -
Uses of Instant in java.nio.file.attribute
Methods in java.nio.file.attribute that return Instant Modifier and Type Method Description InstantFileTime. toInstant()Converts thisFileTimeobject to anInstant.Methods in java.nio.file.attribute with parameters of type Instant Modifier and Type Method Description static FileTimeFileTime. from(Instant instant)Returns aFileTimerepresenting the same point of time value on the time-line as the providedInstantobject. -
Uses of Instant in java.sql
Methods in java.sql that return Instant Modifier and Type Method Description InstantDate. toInstant()This method always throws an UnsupportedOperationException and should not be used because SQLDatevalues do not have a time component.InstantTime. toInstant()This method always throws an UnsupportedOperationException and should not be used because SQLTimevalues do not have a date component.InstantTimestamp. toInstant()Converts thisTimestampobject to anInstant. -
Uses of Instant in java.time
Fields in java.time declared as Instant Modifier and Type Field Description static InstantInstant. EPOCHConstant for the 1970-01-01T00:00:00Z epoch instant.static InstantInstant. MAXThe maximum supportedInstant, '1000000000-12-31T23:59:59.999999999Z'.static InstantInstant. MINThe minimum supportedInstant, '-1000000000-01-01T00:00Z'.Methods in java.time that return Instant Modifier and Type Method Description static InstantInstant. from(TemporalAccessor temporal)Obtains an instance ofInstantfrom a temporal object.abstract InstantClock. instant()Gets the current instant of the clock.InstantInstant. minus(long amountToSubtract, TemporalUnit unit)Returns a copy of this instant with the specified amount subtracted.InstantInstant. minus(TemporalAmount amountToSubtract)Returns a copy of this instant with the specified amount subtracted.InstantInstant. minusMillis(long millisToSubtract)Returns a copy of this instant with the specified duration in milliseconds subtracted.InstantInstant. minusNanos(long nanosToSubtract)Returns a copy of this instant with the specified duration in nanoseconds subtracted.InstantInstant. minusSeconds(long secondsToSubtract)Returns a copy of this instant with the specified duration in seconds subtracted.static InstantInstant. now()Obtains the current instant from the system clock.static InstantInstant. now(Clock clock)Obtains the current instant from the specified clock.static InstantInstant. ofEpochMilli(long epochMilli)Obtains an instance ofInstantusing milliseconds from the epoch of 1970-01-01T00:00:00Z.static InstantInstant. ofEpochSecond(long epochSecond)Obtains an instance ofInstantusing seconds from the epoch of 1970-01-01T00:00:00Z.static InstantInstant. ofEpochSecond(long epochSecond, long nanoAdjustment)Obtains an instance ofInstantusing seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.static InstantInstant. parse(CharSequence text)Obtains an instance ofInstantfrom a text string such as2007-12-03T10:15:30.00Z.InstantInstant. plus(long amountToAdd, TemporalUnit unit)Returns a copy of this instant with the specified amount added.InstantInstant. plus(TemporalAmount amountToAdd)Returns a copy of this instant with the specified amount added.InstantInstant. plusMillis(long millisToAdd)Returns a copy of this instant with the specified duration in milliseconds added.InstantInstant. plusNanos(long nanosToAdd)Returns a copy of this instant with the specified duration in nanoseconds added.InstantInstant. plusSeconds(long secondsToAdd)Returns a copy of this instant with the specified duration in seconds added.InstantOffsetDateTime. toInstant()Converts this date-time to anInstant.InstantInstant. truncatedTo(TemporalUnit unit)Returns a copy of thisInstanttruncated to the specified unit.InstantInstant. with(TemporalAdjuster adjuster)Returns an adjusted copy of this instant.InstantInstant. with(TemporalField field, long newValue)Returns a copy of this instant with the specified field set to a new value.Methods in java.time with parameters of type Instant Modifier and Type Method Description intInstant. compareTo(Instant otherInstant)Compares this instant to the specified instant.static ClockClock. fixed(Instant fixedInstant, ZoneId zone)Obtains a clock that always returns the same instant.booleanInstant. isAfter(Instant otherInstant)Checks if this instant is after the specified instant.booleanInstant. isBefore(Instant otherInstant)Checks if this instant is before the specified instant.static LocalDateLocalDate. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalDatefrom anInstantand zone ID.static LocalDateTimeLocalDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalDateTimefrom anInstantand zone ID.static LocalTimeLocalTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofLocalTimefrom anInstantand zone ID.static OffsetDateTimeOffsetDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetDateTimefrom anInstantand zone ID.static OffsetTimeOffsetTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofOffsetTimefrom anInstantand zone ID.static ZonedDateTimeZonedDateTime. ofInstant(Instant instant, ZoneId zone)Obtains an instance ofZonedDateTimefrom anInstant. -
Uses of Instant in java.time.chrono
Methods in java.time.chrono that return Instant Modifier and Type Method Description default InstantChronoLocalDateTime. toInstant(ZoneOffset offset)Converts this date-time to anInstant.default InstantChronoZonedDateTime. toInstant()Converts this date-time to anInstant.Methods in java.time.chrono with parameters of type Instant Modifier and Type Method Description default ChronoZonedDateTime<? extends ChronoLocalDate>Chronology. zonedDateTime(Instant instant, ZoneId zone)Obtains aChronoZonedDateTimein this chronology from anInstant.ChronoZonedDateTime<HijrahDate>HijrahChronology. zonedDateTime(Instant instant, ZoneId zone)ZonedDateTimeIsoChronology. zonedDateTime(Instant instant, ZoneId zone)Obtains an ISO zoned date-time in this chronology from anInstant.ChronoZonedDateTime<JapaneseDate>JapaneseChronology. zonedDateTime(Instant instant, ZoneId zone)ChronoZonedDateTime<MinguoDate>MinguoChronology. zonedDateTime(Instant instant, ZoneId zone)ChronoZonedDateTime<ThaiBuddhistDate>ThaiBuddhistChronology. zonedDateTime(Instant instant, ZoneId zone) -
Uses of Instant in java.time.zone
Methods in java.time.zone that return Instant Modifier and Type Method Description InstantZoneOffsetTransition. getInstant()Gets the transition instant.Methods in java.time.zone with parameters of type Instant Modifier and Type Method Description DurationZoneRules. getDaylightSavings(Instant instant)Gets the amount of daylight savings in use for the specified instant in this zone.ZoneOffsetZoneRules. getOffset(Instant instant)Gets the offset applicable at the specified instant in these rules.ZoneOffsetZoneRules. getStandardOffset(Instant instant)Gets the standard offset for the specified instant in this zone.booleanZoneRules. isDaylightSavings(Instant instant)Checks if the specified instant is in daylight savings.ZoneOffsetTransitionZoneRules. nextTransition(Instant instant)Gets the next transition after the specified instant.ZoneOffsetTransitionZoneRules. previousTransition(Instant instant)Gets the previous transition before the specified instant. -
Uses of Instant in java.util
-
Uses of Instant in java.util.logging
Methods in java.util.logging that return Instant Modifier and Type Method Description InstantLogRecord. getInstant()Gets the instant that the event occurred.Methods in java.util.logging with parameters of type Instant Modifier and Type Method Description voidLogRecord. setInstant(Instant instant)Sets the instant that the event occurred. -
Uses of Instant in jdk.jfr
Methods in jdk.jfr that return Instant Modifier and Type Method Description InstantRecording. getStartTime()Returns the time when this recording was started.InstantRecording. getStopTime()Returns the time when this recording was stopped. -
Uses of Instant in jdk.jfr.consumer
Methods in jdk.jfr.consumer that return Instant Modifier and Type Method Description InstantRecordedEvent. getEndTime()Returns the end time of the event.InstantRecordedObject. getInstant(String name)Returns the value of a timestamp field.InstantRecordedEvent. getStartTime()Returns the start time of the event.Methods in jdk.jfr.consumer with parameters of type Instant Modifier and Type Method Description voidEventStream. setEndTime(Instant endTime)Specifies the end time of the stream.voidEventStream. setStartTime(Instant startTime)Specifies the start time of the stream.