Uses of Class
java.time.Instant
Packages that use Instant
Package
Description
Provides classes that are fundamental to the design of the Java
programming language.
Interfaces and classes providing access to file and file system attributes.
Provides the API for accessing and processing data stored in a
data source (usually a relational database) using the
Java programming language.
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
Support for time-zones and their rules.
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.
Utility classes commonly useful in concurrent programming.
Provides the classes and interfaces of
the Java 2 platform's core logging facilities.
This package provides classes to create events and control Flight Recorder.
This package contains classes for consuming Flight Recorder data.
This package contains classes to control and monitor Flight Recorder over Java Management Extensions (JMX).
-
Uses of Instant in java.lang
Modifier and TypeMethodDescriptionProcessHandle.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 InstantModifier and TypeMethodDescriptionFileTime.toInstant()Converts thisFileTimeobject to anInstant.Methods in java.nio.file.attribute with parameters of type Instant -
Uses of Instant in java.sql
Modifier and TypeMethodDescriptionDate.toInstant()This method always throws an UnsupportedOperationException and should not be used because SQLDatevalues do not have a time component.Time.toInstant()This method always throws an UnsupportedOperationException and should not be used because SQLTimevalues do not have a date component.Timestamp.toInstant()Converts thisTimestampobject to anInstant. -
Uses of Instant in java.time
Modifier and TypeFieldDescriptionstatic final InstantInstant.EPOCHConstant for the 1970-01-01T00:00:00Z epoch instant.static final InstantInstant.MAXThe maximum supportedInstant, '1000000000-12-31T23:59:59.999999999Z'.static final InstantInstant.MINThe minimum supportedInstant, '-1000000000-01-01T00:00Z'.Modifier and TypeMethodDescriptionstatic InstantInstant.from(TemporalAccessor temporal) Obtains an instance ofInstantfrom a temporal object.abstract InstantClock.instant()Gets the current instant of the clock.InstantSource.instant()Gets the current instant of the source.Instant.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this instant with the specified amount subtracted.Instant.minus(TemporalAmount amountToSubtract) Returns a copy of this instant with the specified amount subtracted.Instant.minusMillis(long millisToSubtract) Returns a copy of this instant with the specified duration in milliseconds subtracted.Instant.minusNanos(long nanosToSubtract) Returns a copy of this instant with the specified duration in nanoseconds subtracted.Instant.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 InstantObtains 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.Instant.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this instant with the specified amount added.Instant.plus(TemporalAmount amountToAdd) Returns a copy of this instant with the specified amount added.Instant.plusMillis(long millisToAdd) Returns a copy of this instant with the specified duration in milliseconds added.Instant.plusNanos(long nanosToAdd) Returns a copy of this instant with the specified duration in nanoseconds added.Instant.plusSeconds(long secondsToAdd) Returns a copy of this instant with the specified duration in seconds added.OffsetDateTime.toInstant()Converts this date-time to anInstant.Instant.truncatedTo(TemporalUnit unit) Returns a copy of thisInstanttruncated to the specified unit.Instant.with(TemporalAdjuster adjuster) Returns an adjusted copy of this instant.Instant.with(TemporalField field, long newValue) Returns a copy of this instant with the specified field set to a new value.Modifier and TypeMethodDescriptionintCompares this instant to the specified instant.static ClockObtains a clock that always returns the same instant.static InstantSourceObtains a source that always returns the same instant.booleanChecks if this instant is after the specified instant.booleanChecks if this instant is before the specified instant.static LocalDateObtains an instance ofLocalDatefrom anInstantand zone ID.static LocalDateTimeObtains an instance ofLocalDateTimefrom anInstantand zone ID.static LocalTimeObtains an instance ofLocalTimefrom anInstantand zone ID.static OffsetDateTimeObtains an instance ofOffsetDateTimefrom anInstantand zone ID.static OffsetTimeObtains an instance ofOffsetTimefrom anInstantand zone ID.static ZonedDateTimeObtains an instance ofZonedDateTimefrom anInstant. -
Uses of Instant in java.time.chrono
Methods in java.time.chrono that return InstantModifier and TypeMethodDescriptiondefault 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 InstantModifier and TypeMethodDescriptiondefault ChronoZonedDateTime<? extends ChronoLocalDate> Chronology.zonedDateTime(Instant instant, ZoneId zone) Obtains aChronoZonedDateTimein this chronology from anInstant.HijrahChronology.zonedDateTime(Instant instant, ZoneId zone) IsoChronology.zonedDateTime(Instant instant, ZoneId zone) Obtains an ISO zoned date-time in this chronology from anInstant.JapaneseChronology.zonedDateTime(Instant instant, ZoneId zone) MinguoChronology.zonedDateTime(Instant instant, ZoneId zone) ThaiBuddhistChronology.zonedDateTime(Instant instant, ZoneId zone) -
Uses of Instant in java.time.zone
Methods in java.time.zone that return InstantMethods in java.time.zone with parameters of type InstantModifier and TypeMethodDescriptionZoneRules.getDaylightSavings(Instant instant) Gets the amount of daylight savings in use for the specified instant in this zone.Gets the offset applicable at the specified instant in these rules.ZoneRules.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.ZoneRules.nextTransition(Instant instant) Gets the next transition after the specified instant.ZoneRules.previousTransition(Instant instant) Gets the previous transition before the specified instant. -
Uses of Instant in java.util
-
Uses of Instant in java.util.concurrent
Methods in java.util.concurrent with parameters of type InstantModifier and TypeMethodDescriptionWait for all subtasks started in this task scope to finish or the task scope to shut down, up to the given deadline.Wait for a subtask started in this task scope to complete successfullyPREVIEW or all subtasks to complete, up to the given deadline. -
Uses of Instant in java.util.logging
Methods in java.util.logging that return InstantModifier and TypeMethodDescriptionLogRecord.getInstant()Gets the instant that the event occurred.Methods in java.util.logging with parameters of type InstantModifier and TypeMethodDescriptionvoidLogRecord.setInstant(Instant instant) Sets the instant that the event occurred. -
Uses of Instant in jdk.jfr
Modifier and TypeMethodDescriptionRecording.getStartTime()Returns the time when this recording was started.Recording.getStopTime()Returns the time when this recording was stopped.Modifier and TypeMethodDescriptionCreates a data stream for a specified interval. -
Uses of Instant in jdk.jfr.consumer
Methods in jdk.jfr.consumer that return InstantModifier and TypeMethodDescriptionRecordedEvent.getEndTime()Returns the end time of the event.final InstantRecordedObject.getInstant(String name) Returns the value of a timestamp field.RecordedEvent.getStartTime()Returns the start time of the event.Methods in jdk.jfr.consumer with parameters of type InstantModifier and TypeMethodDescriptionvoidEventStream.setEndTime(Instant endTime) Specifies the end time of the stream.voidRecordingStream.setEndTime(Instant endTime) voidEventStream.setStartTime(Instant startTime) Specifies the start time of the stream.voidRecordingStream.setStartTime(Instant startTime) -
Uses of Instant in jdk.management.jfr
Methods in jdk.management.jfr with parameters of type InstantModifier and TypeMethodDescriptionvoidRemoteRecordingStream.setEndTime(Instant endTime) voidRemoteRecordingStream.setStartTime(Instant startTime)