Uses of Class
net.time4j.Moment
Package
Description
The main package contains four basic types of ISO-8601, namely
PlainDate
, PlainTime
, PlainTimestamp
and Moment
.Support for various regional calendars.
Contains classes related to calendrical astronomy.
Contains miscellaneous clock implementations.
This package contains the expert-level format- and parse engine of Time4J.
Temporal formatters which access the platform specific resources.
Interval support.
Bridge to JDBC.
-
Uses of Moment in net.time4j
Modifier and TypeFieldDescriptionstatic Moment
Moment.UNIX_EPOCH
Start of UNIX-era = [1970-01-01T00:00:00,000000000Z].Modifier and TypeFieldDescriptionstatic TemporalType<Instant,Moment>
TemporalType.INSTANT
Bridge between the JSR-310-classjava.time.Instant
and the classMoment
.static TemporalType<Date,Moment>
TemporalType.JAVA_UTIL_DATE
Bridge between a traditional Java timestamp of typejava.util.Date
and the classMoment
.static TemporalType<Long,Moment>
TemporalType.MILLIS_SINCE_UNIX
Bridge between a traditional Java timestamp as count of milliseconds since UNIX-epoch and the classMoment
.Modifier and TypeMethodDescriptionGeneralTimestamp.at(ZonalOffset offset, StartOfDay startOfDay)
Combines this general timestamp with given timezone offset to a global UTC-moment.PlainTimestamp.at(ZonalOffset offset)
Combines this local timestamp with the given timezone offset to a global UTC-moment.PlainDate.atFirstMoment(String tzid)
Creates a new moment which corresponds to this date at earliest valid time at the begin of associated day in given timezone.PlainDate.atFirstMoment(TZID tzid)
Creates a new moment which corresponds to this date at earliest valid time at the begin of associated day in given timezone.PlainTimestamp.atUTC()
Combines this local timestamp with the timezone offset UTC+00:00 to a global UTC-moment.static Moment
SystemClock.currentMoment()
Equivalent toSystemClock.INSTANCE.currentTime()
.SystemClock.currentTime()
static Moment
Short cut forTemporalType.INSTANT.translate(instant)
.static Moment
Common conversion method.GeneralTimestamp.in(Timezone tz, StartOfDay startOfDay)
Combines this general timestamp with given timezone to a global UTC-moment.Combines this local timestamp with given timezone to a global UTC-moment.PlainTimestamp.inStdTimezone()
Combines this local timestamp with the system timezone to a global UTC-moment.PlainTimestamp.inTimezone(TZID tzid)
Combines this local timestamp with given timezone to a global UTC-moment.Subtracts an amount of given SI-unit from this timestamp on the UTC time scale.Moment.minus(MachineTime<SI> realTime)
Subtracts given real time from this timestamp on the UTC time scale.static Moment
Moment.nowInSystemTime()
Obtains the current time using the system clock.static Moment
Creates a new UTC-timestamp by given time coordinates on given time scale.static Moment
Equivalent toMoment.of(elapsedTime, 0, scale)
.static Moment
Moment.parse(String text, TemporalFormatter<Moment> parser)
Parses given text to an instance of this class.Adds an amount of given SI-unit to this timestamp on the UTC time scale.Moment.plus(MachineTime<SI> realTime)
Adds given real time to this timestamp on the UTC time scale.ZonalDateTime.toMoment()
Converts this object to a global UTC-moment.Modifier and TypeMethodDescriptionElementOperator.at(ZonalOffset offset)
Creates an operator which can adjust aMoment
at the given timezone offset.ZonalElement.at(ZonalOffset offset)
Creates a function which can query aMoment
at the given timezone offset.ElementOperator.atUTC()
Equivalent toat(ZonalOffset.UTC)
.ZonalElement.atUTC()
Equivalent toat(ZonalOffset.UTC)
.Moment.axis()
Provides a static access to the associated time axis respective chronology which contains the chronological rules.Creates an operator which can adjust aMoment
in the given timezone.Creates a function which can query aMoment
in the given timezone.ElementOperator.inStdTimezone()
Creates an operator which can adjust aMoment
in the system timezone.ZonalElement.inStdTimezone()
Creates a function which can query aMoment
in the system timezone.ElementOperator.inTimezone(TZID tzid)
Creates an operator which can adjust aMoment
in the given timezone.ZonalElement.inTimezone(TZID tzid)
Creates a function which can query aMoment
in the given timezone.static ChronoOperator<Moment>
Moment.nextLeapSecond()
Tries to determine the next coming leap second.Modifier and TypeMethodDescriptionlong
Calculates the time distance between given time points in SI-units.int
long
Calculates the time distance between this timestamp and given end timestamp in given SI-unit on the UTC time scale.Modifier and TypeMethodDescriptionstatic <S> Chronology<S>
Provides a static access to the associated time axis using the foreign type S.static Moment
Moment.parse(String text, TemporalFormatter<Moment> parser)
Parses given text to an instance of this class.static ZonalDateTime
ZonalDateTime.parse(String text, TemporalFormatter<Moment> parser)
Parses given text to aZonalDateTime
.Moment.print(TemporalFormatter<Moment> printer)
Creates a formatted output of this instance.ZonalDateTime.print(TemporalFormatter<Moment> printer)
Creates a formatted output of this instance.PrettyTime.printRelativeOrDateTime(UnixTime moment, Timezone tz, TimeUnit precision, long maxdelta, TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time ofPrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time.PrettyTime.printRelativeOrDateTime(UnixTime moment, Timezone tz, TimeUnit precision, CalendarUnit maxRelativeUnit, TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time ofPrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time. -
Uses of Moment in net.time4j.calendar
Modifier and TypeMethodDescriptionHebrewTime.on(HebrewCalendar date, Timezone tz)
Obtains the moment at this simplified Hebrew time on given date using a fixed 24-hour-scale.Modifier and TypeMethodDescriptionstatic ChronoFunction<Moment,Optional<HebrewTime>>
Obtains the Hebrew time dependent on given moment and location related to solar time.static ChronoFunction<Moment,HebrewTime>
Obtains the simplified Hebrew time dependent on given moment and a 24-hour-fixed scale.HebrewTime.on(HebrewCalendar date, SolarTime geoLocation)
Obtains the moment at this Hebrew time on given date at the given geographical position. -
Uses of Moment in net.time4j.calendar.astro
Modifier and TypeMethodDescriptionObtains the first moon phase which is after given moment.MoonPhase.atLunation(int n)
Obtains the time of n-th lunation based on this type of phase.Zodiac.Event.atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.Zodiac.Event.atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.Obtains the first moon phase which is at or after given moment.Obtains the last moon phase which is still before given moment.SolarTime.Sunshine.endUTC()
Obtains the moment of sunset if it exists.static Moment
MoonPosition.inNextApogeeAfter(Moment moment)
Obtains the time of next apogee after given moment.static Moment
MoonPosition.inNextPerigeeAfter(Moment moment)
Obtains the time of next perigee after given moment.AstronomicalSeason.inYear(int year)
Determines the moment of this astronomical event in given year.SolarTime.Sunshine.startUTC()
Obtains the moment of sunrise if it exists.JulianDay.toMoment()
Converts this Julian day to aMoment
.Modifier and TypeMethodDescriptionstatic ChronoFunction<Moment,PlainTimestamp>
SolarTime.apparentAt(ZonalOffset offset)
Determines the apparent solar time of any moment at given local time zone offset.static ChronoFunction<Moment,PlainTimestamp>
SolarTime.apparentAt(ZonalOffset offset, String calculator)
Determines the apparent solar time of any moment at given local time zone offset.LunarTime.Moonlight.moonrise()
Obtains the moment of moonrise if it exists.LunarTime.Moonlight.moonset()
Obtains the moment of moonset if it exists.static ChronoFunction<Moment,PlainTimestamp>
SolarTime.onAverage(ZonalOffset offset)
Determines the mean solar time of any moment at given local time zone offset.SolarTime.Calculator.sunrise(CalendarDate date, double latitude, double longitude, double zenith)
Calculates the moment of sunrise.SolarTime.sunrise()
Calculates the moment of sunrise at the location of this instance.Calculates the time of given twilight at sunrise and the location of this instance.SolarTime.Calculator.sunset(CalendarDate date, double latitude, double longitude, double zenith)
Calculates the moment of sunset.SolarTime.sunset()
Calculates the moment of sunset at the location of this instance.Calculates the time of given twilight at sunset and the location of this instance.SolarTime.timeOfShadowAfterNoon(double objectHeight, double shadowLength)
Calculates the moment after noon when the given shadow occurs on given date at the location of this instance.SolarTime.timeOfShadowBeforeNoon(double objectHeight, double shadowLength)
Calculates the moment before noon when the given shadow occurs on given date at the location of this instance.SolarTime.transitAtMidnight()
Calculates the moment of midnight at the location of this instance (lowest position of sun).SolarTime.transitAtNoon()
Calculates the moment of noon at the location of this instance (solar transit).Modifier and TypeMethodDescriptionObtains the first moon phase which is after given moment.static MoonPosition
MoonPosition.at(Moment moment, GeoLocation location)
Calculates the position of moon at given moment and geographical location.static SunPosition
SunPosition.at(Moment moment, GeoLocation location)
Calculates the position of sun at given moment and geographical location.Zodiac.Event.atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.Zodiac.Event.atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.Obtains the first moon phase which is at or after given moment.Obtains the last moon phase which is still before given moment.static Zodiac
Zodiac.constellationPassedByMoon(Moment moment)
Determines the zodiac constellation passed by the moon at given moment.static Zodiac
Zodiac.constellationPassedBySun(Moment moment)
Determines the zodiac constellation passed by the sun at given moment.static double
SolarTime.equationOfTime(Moment moment)
Determines the difference between apparent and mean solar time at given moment.static double
SolarTime.equationOfTime(Moment moment, String calculator)
Determines the difference between apparent and mean solar time at given moment.static double
MoonPhase.getIllumination(Moment moment)
Determines the degree of illumination of the moon at given moment.static double
MoonPhase.getIllumination(Moment moment, int precision)
Determines the degree of illumination of the moon at given moment.static Moment
MoonPosition.inNextApogeeAfter(Moment moment)
Obtains the time of next apogee after given moment.static Moment
MoonPosition.inNextPerigeeAfter(Moment moment)
Obtains the time of next perigee after given moment.boolean
Is the moon above the horizon at given moment?boolean
Is there any sunshine at given moment?static AstronomicalSeason
Determines the astronomical season related to given moment.static JulianDay
JulianDay.ofEphemerisTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.TT
, sometimes also called Julian Ephemeris Day.static JulianDay
JulianDay.ofMeanSolarTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.UT
, hence related to the mean solar time.static JulianDay
JulianDay.ofSimplifiedTime(Moment moment)
Creates a Julian day on the time scaleTimeScale.POSIX
.static Zodiac
Zodiac.signPassedByMoon(Moment moment)
Determines the zodiac sign passed by the moon at given moment.static Zodiac
Zodiac.signPassedBySun(Moment moment)
Determines the zodiac sign passed by the sun at given moment.boolean
Tests if this event happens at given moment. -
Uses of Moment in net.time4j.clock
Modifier and TypeMethodDescriptionAdjustableClock.currentTime()
FixedClock.currentTime()
NetTimeConnector.currentTime()
Yields the current time after a connection has been established at least once.NetTimeConnector.getLastConnectionTime()
Yields the time of last connection.ModifierConstructorDescriptionDaytimeClock(String server, ChronoParser<Moment> parser)
Creates a new instance which uses the given time server on the port 13. -
Uses of Moment in net.time4j.format.expert
Modifier and TypeFieldDescriptionstatic ChronoFormatter<Moment>
Iso8601Format.BASIC_DATE_TIME_OFFSET
Defines the basic ISO-8601-format for a composition of calendar date, wall time and timezone offset using the pattern "uuuuMMdd'T'HH[mm[ss[,SSSSSSSSS]]]{offset}".static ChronoFormatter<Moment>
Iso8601Format.EXTENDED_DATE_TIME_OFFSET
Defines the extended ISO-8601-format for a composition of calendar date, wall time and timezone offset using the pattern "uuuu-MM-dd'T'HH[:mm[:ss[,SSSSSSSSS]]]{offset}".static ChronoFormatter<Moment>
ChronoFormatter.RFC_1123
Special formatter for printing or parsing moments according to the RFC-1123-specification.Modifier and TypeMethodDescriptionstatic ChronoFormatter<Moment>
ChronoFormatter.ofGenericMomentPattern(String pattern, Locale locale)
Constructs a CLDR-pattern-based formatter for universal timestamps with calendar override derived from given locale.static ChronoPrinter<Moment>
Iso8601Format.ofMoment(IsoDateStyle dateStyle, IsoDecimalStyle decimalStyle, ClockUnit precision, ZonalOffset offset)
Obtains a printer with given styles for printing a moment.static ChronoParser<Moment>
ChronoFormatter.ofMomentPattern(String pattern, PatternType type, Locale locale)
Constructs a pattern-based parser for global timestamp objects.static ChronoFormatter<Moment>
ChronoFormatter.ofMomentPattern(String pattern, PatternType type, Locale locale, TZID tzid)
Constructs a pattern-based formatter for global timestamp objects.static ChronoFormatter<Moment>
ChronoFormatter.ofMomentStyle(FormatStyle dateStyle, FormatStyle timeStyle, Locale locale, TZID tzid)
Constructs a style-based formatter for moments.static ChronoFormatter<Moment>
ChronoFormatter.ofMomentStyle(DisplayMode dateStyle, DisplayMode timeStyle, Locale locale, TZID tzid)
Deprecated.static <C extends CalendarVariant<C>>
ChronoFormatter.Builder<Moment>ChronoFormatter.setUpWithOverride(Locale locale, CalendarFamily<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.static <C extends Calendrical<?, C>>
ChronoFormatter.Builder<Moment>ChronoFormatter.setUpWithOverride(Locale locale, Chronology<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type. -
Uses of Moment in net.time4j.format.platform
Modifier and TypeFieldDescriptionstatic SimpleFormatter<Moment>
SimpleFormatter.RFC_1123
Defines the RFC-1123-format which is for example used in mail headers (technical internet-timestamp).Modifier and TypeMethodDescriptionstatic SimpleFormatter<Moment>
SimpleFormatter.ofMomentPattern(String pattern, Locale locale, TZID tzid)
Constructs a pattern-based formatter for global timestamp objects (moments).static SimpleFormatter<Moment>
SimpleFormatter.ofMomentStyle(FormatStyle dateStyle, FormatStyle timeStyle, Locale locale, TZID tzid)
Constructs a style-based formatter for global timestamp objects (moments).static SimpleFormatter<Moment>
SimpleFormatter.ofMomentStyle(DisplayMode dateStyle, DisplayMode timeStyle, Locale locale, TZID tzid)
-
Uses of Moment in net.time4j.range
Modifier and TypeMethodDescriptionstatic <I extends ChronoInterval<Moment>>
IntervalTree<Moment,I>IntervalTree.onMomentAxis(Collection<I> intervals)
Creates an interval tree on the moment axis (UTC) filled with given moment intervals.Modifier and TypeMethodDescriptionMomentInterval.getEndAsMoment()
Yields the end time point.MomentInterval.getStartAsMoment()
Yields the start time point.MomentInterval.random()
Obtains a random moment within this interval.Modifier and TypeMethodDescriptionstatic Comparator<ChronoInterval<Moment>>
MomentInterval.comparator()
Defines a comparator which sorts intervals first by start boundary and then by length.static IntervalCollection<Moment>
IntervalCollection.onMomentAxis()
Yields an empty instance on the UTC-axis.static <I extends ChronoInterval<Moment>>
IntervalTree<Moment,I>IntervalTree.onMomentAxis(Collection<I> intervals)
Creates an interval tree on the moment axis (UTC) filled with given moment intervals.MomentInterval.stream(MachineTime<?> duration)
Obtains a stream iterating over every moment which is the result of addition of given duration to start until the end of this interval is reached.MomentInterval.stream(MachineTime<?> duration, Moment start, Moment end)
Obtains a stream iterating over every moment which is the result of addition of given duration to start until the end is reached.Modifier and TypeMethodDescriptionstatic MomentInterval
Creates a finite half-open interval between given time points.static IsoRecurrence<MomentInterval>
IsoRecurrence.of(int count, Duration<?> duration, Moment end, ZonalOffset offset)
Creates a recurrent backward sequence of moment intervals having given duration.static IsoRecurrence<MomentInterval>
IsoRecurrence.of(int count, Moment start, Duration<?> duration, ZonalOffset offset)
Creates a recurrent sequence of moment intervals having given duration.static IsoRecurrence<MomentInterval>
IsoRecurrence.of(int count, Moment start, Moment end, ZonalOffset offset)
Creates a recurrent sequence of moment intervals having the duration of first timestamp interval in years, months, days, hours, minutes, seconds and nanoseconds.static MomentInterval
Creates an infinite half-open interval since given start.MomentInterval.stream(MachineTime<?> duration, Moment start, Moment end)
Obtains a stream iterating over every moment which is the result of addition of given duration to start until the end is reached.static MomentInterval
MomentInterval.surrounding(Moment moment, MachineTime<?> duration, double alignment)
Creates an interval surrounding given moment.static MomentInterval
Creates an infinite open interval until given end.Modifier and TypeMethodDescriptionstatic MomentInterval
MomentInterval.from(ChronoInterval<Moment> interval)
Converts an arbitrary moment interval to an interval of this type.static MomentInterval
MomentInterval.parse(CharSequence text, ChronoParser<Moment> startFormat, char separator, ChronoParser<Moment> endFormat, BracketPolicy policy, ParseLog status)
Interpretes given text as interval.static MomentInterval
MomentInterval.parse(CharSequence text, ChronoParser<Moment> parser, BracketPolicy policy)
Interpretes given text as interval.static MomentInterval
MomentInterval.parse(String text, ChronoParser<Moment> parser)
Interpretes given text as interval using a localized interval pattern.static MomentInterval
MomentInterval.parse(String text, ChronoParser<Moment> parser, String intervalPattern)
Interpretes given text as interval using given interval pattern. -
Uses of Moment in net.time4j.sql
Modifier and TypeFieldDescriptionstatic JDBCAdapter<Timestamp,Moment>
JDBCAdapter.SQL_TIMESTAMP_WITH_ZONE
Bridge between a JDBC-Timestamp and the classMoment
.
ChronoFormatter.ofMomentStyle(FormatStyle, FormatStyle, Locale, TZID)