| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.calendar |
Support for various regional calendars.
|
| net.time4j.calendar.astro |
Contains classes related to calendrical astronomy.
|
| net.time4j.clock |
Contains miscellaneous clock implementations.
|
| net.time4j.format.expert |
This package contains the expert-level format- and parse engine of Time4J.
|
| net.time4j.format.platform |
Temporal formatters which access the platform specific resources.
|
| net.time4j.range |
Interval support.
|
| Modifier and Type | Field and Description |
|---|---|
static Moment |
Moment.UNIX_EPOCH
Start of UNIX-era = [1970-01-01T00:00:00,000000000Z].
|
| Modifier and Type | Field and Description |
|---|---|
static TemporalType<Instant,Moment> |
TemporalType.INSTANT
Bridge between the JSR-310-class
java.time.Instant and
the class Moment. |
static TemporalType<Date,Moment> |
TemporalType.JAVA_UTIL_DATE
Bridge between a traditional Java timestamp of type
java.util.Date and the class Moment. |
static TemporalType<Long,Moment> |
TemporalType.MILLIS_SINCE_UNIX
Bridge between a traditional Java timestamp as count of milliseconds
since UNIX-epoch and the class
Moment. |
| Modifier and Type | Method and Description |
|---|---|
Moment |
PlainTimestamp.at(ZonalOffset offset)
Combines this local timestamp with the given timezone offset
to a global UTC-moment.
|
Moment |
GeneralTimestamp.at(ZonalOffset offset,
StartOfDay startOfDay)
Combines this general timestamp with given timezone offset to a global UTC-moment.
|
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.
|
Moment |
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.
|
Moment |
PlainTimestamp.atUTC()
Combines this local timestamp with the timezone offset UTC+00:00
to a global UTC-moment.
|
static Moment |
SystemClock.currentMoment()
Equivalent to
SystemClock.INSTANCE.currentTime(). |
Moment |
SystemClock.currentTime() |
static Moment |
Moment.from(Instant instant)
Short cut for
TemporalType.INSTANT.translate(instant). |
static Moment |
Moment.from(UnixTime ut)
Common conversion method.
|
Moment |
PlainTimestamp.in(Timezone tz)
Combines this local timestamp with given timezone to a global
UTC-moment.
|
Moment |
GeneralTimestamp.in(Timezone tz,
StartOfDay startOfDay)
Combines this general timestamp with given timezone to a global UTC-moment.
|
Moment |
PlainTimestamp.inStdTimezone()
Combines this local timestamp with the system timezone to a global
UTC-moment.
|
Moment |
PlainTimestamp.inTimezone(TZID tzid)
Combines this local timestamp with given timezone to a global
UTC-moment.
|
Moment |
Moment.minus(long amount,
SI unit)
Subtracts an amount of given SI-unit from this timestamp
on the UTC time scale.
|
Moment |
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 |
Moment.of(long elapsedTime,
int nanosecond,
TimeScale scale)
Creates a new UTC-timestamp by given time coordinates on given
time scale.
|
static Moment |
Moment.of(long elapsedTime,
TimeScale scale)
Equivalent to
Moment.of(elapsedTime, 0, scale). |
static Moment |
Moment.parse(String text,
TemporalFormatter<Moment> parser)
Parses given text to an instance of this class.
|
Moment |
Moment.plus(long amount,
SI unit)
Adds an amount of given SI-unit to this timestamp
on the UTC time scale.
|
Moment |
Moment.plus(MachineTime<SI> realTime)
Adds given real time to this timestamp on the UTC time scale.
|
Moment |
ZonalDateTime.toMoment()
Converts this object to a global UTC-moment.
|
| Modifier and Type | Method and Description |
|---|---|
ChronoFunction<Moment,V> |
ZonalElement.at(ZonalOffset offset)
Creates a function which can query a
Moment at the
given timezone offset. |
ChronoOperator<Moment> |
ElementOperator.at(ZonalOffset offset)
Creates an operator which can adjust a
Moment at the
given timezone offset. |
ChronoFunction<Moment,V> |
ZonalElement.atUTC()
Equivalent to
at(ZonalOffset.UTC). |
ChronoOperator<Moment> |
ElementOperator.atUTC()
Equivalent to
at(ZonalOffset.UTC). |
static TimeAxis<TimeUnit,Moment> |
Moment.axis()
Provides a static access to the associated time axis respective
chronology which contains the chronological rules.
|
ChronoFunction<Moment,V> |
ZonalElement.in(Timezone tz)
Creates a function which can query a
Moment in the
given timezone. |
ChronoOperator<Moment> |
ElementOperator.in(Timezone tz)
Creates an operator which can adjust a
Moment in the
given timezone. |
ChronoFunction<Moment,V> |
ZonalElement.inStdTimezone()
Creates a function which can query a
Moment in the
system timezone. |
ChronoOperator<Moment> |
ElementOperator.inStdTimezone()
Creates an operator which can adjust a
Moment in the
system timezone. |
ChronoFunction<Moment,V> |
ZonalElement.inTimezone(TZID tzid)
Creates a function which can query a
Moment in the
given timezone. |
ChronoOperator<Moment> |
ElementOperator.inTimezone(TZID tzid)
Creates an operator which can adjust a
Moment in the
given timezone. |
static ChronoOperator<Moment> |
Moment.nextLeapSecond()
Tries to determine the next coming leap second.
|
| Modifier and Type | Method and Description |
|---|---|
long |
SI.between(Moment start,
Moment end)
Calculates the time distance between given time points
in SI-units.
|
int |
Moment.compareTo(Moment moment) |
long |
Moment.until(Moment end,
SI unit)
Calculates the time distance between this timestamp and given
end timestamp in given SI-unit on the UTC time scale.
|
| Modifier and Type | Method and Description |
|---|---|
static <S> Chronology<S> |
Moment.axis(Converter<S,Moment> converter)
Provides a static access to the associated time axis using the foreign type S.
|
static ZonalDateTime |
ZonalDateTime.parse(String text,
TemporalFormatter<Moment> parser)
Parses given text to a
ZonalDateTime. |
static Moment |
Moment.parse(String text,
TemporalFormatter<Moment> parser)
Parses given text to an instance of this class.
|
String |
ZonalDateTime.print(TemporalFormatter<Moment> printer)
Creates a formatted output of this instance.
|
String |
Moment.print(TemporalFormatter<Moment> printer)
Creates a formatted output of this instance.
|
String |
PrettyTime.printRelativeOrDateTime(UnixTime moment,
Timezone tz,
TimeUnit precision,
CalendarUnit maxRelativeUnit,
TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time of
PrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time. |
String |
PrettyTime.printRelativeOrDateTime(UnixTime moment,
Timezone tz,
TimeUnit precision,
long maxdelta,
TemporalFormatter<Moment> formatter)
Formats given time point relative to the current time of
PrettyTime.getReferenceClock()
as duration in given precision or as absolute date-time. |
| Modifier and Type | Method and Description |
|---|---|
Moment |
HebrewTime.on(HebrewCalendar date,
Timezone tz)
Obtains the moment at this simplified Hebrew time on given date using a fixed 24-hour-scale.
|
| Modifier and Type | Method and Description |
|---|---|
static ChronoFunction<Moment,Optional<HebrewTime>> |
HebrewTime.at(SolarTime geoLocation)
Obtains the Hebrew time dependent on given moment and location related to solar time.
|
static ChronoFunction<Moment,HebrewTime> |
HebrewTime.at(TZID tzid)
Obtains the simplified Hebrew time dependent on given moment and a 24-hour-fixed scale.
|
Optional<Moment> |
HebrewTime.on(HebrewCalendar date,
SolarTime geoLocation)
Obtains the moment at this Hebrew time on given date at the given geographical position.
|
| Modifier and Type | Method and Description |
|---|---|
static SolarTerm |
SolarTerm.of(Moment moment)
Obtains an instance of
SolarTerm at given moment. |
| Modifier and Type | Method and Description |
|---|---|
Moment |
MoonPhase.after(Moment moment)
Obtains the first moon phase which is after given moment.
|
Moment |
MoonPhase.atLunation(int n)
Obtains the time of n-th lunation based on this type of phase.
|
Moment |
Zodiac.Event.atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.
|
Moment |
Zodiac.Event.atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.
|
Moment |
MoonPhase.atOrAfter(Moment moment)
Obtains the first moon phase which is at or after given moment.
|
Moment |
MoonPhase.before(Moment moment)
Obtains the last moon phase which is still before given moment.
|
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.
|
Moment |
AstronomicalSeason.inYear(int year)
Determines the moment of this astronomical event in given year.
|
Moment |
SolarTime.Sunshine.startUTC()
Obtains the moment of sunrise if it exists.
|
Moment |
JulianDay.toMoment()
Converts this Julian day to a
Moment. |
| Modifier and Type | Method and Description |
|---|---|
static 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.
|
Optional<Moment> |
LunarTime.Moonlight.moonrise()
Obtains the moment of moonrise if it exists.
|
Optional<Moment> |
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.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
SolarTime.sunrise()
Calculates the moment of sunrise at the location of this instance.
|
Optional<Moment> |
SolarTime.Calculator.sunrise(CalendarDate date,
double latitude,
double longitude,
double zenith)
Calculates the moment of sunrise.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
SolarTime.sunrise(Twilight twilight)
Calculates the time of given twilight at sunrise and the location of this instance.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
SolarTime.sunset()
Calculates the moment of sunset at the location of this instance.
|
Optional<Moment> |
SolarTime.Calculator.sunset(CalendarDate date,
double latitude,
double longitude,
double zenith)
Calculates the moment of sunset.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
SolarTime.sunset(Twilight twilight)
Calculates the time of given twilight at sunset and the location of this instance.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
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.
|
ChronoFunction<CalendarDate,Optional<Moment>> |
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.
|
ChronoFunction<CalendarDate,Moment> |
SolarTime.transitAtMidnight()
Calculates the moment of midnight at the location of this instance (lowest position of sun).
|
ChronoFunction<CalendarDate,Moment> |
SolarTime.transitAtNoon()
Calculates the moment of noon at the location of this instance (solar transit).
|
| Modifier and Type | Method and Description |
|---|---|
Moment |
MoonPhase.after(Moment moment)
Obtains the first moon phase which is after given moment.
|
static SunPosition |
SunPosition.at(Moment moment,
GeoLocation location)
Calculates the position of sun at given moment and geographical location.
|
static MoonPosition |
MoonPosition.at(Moment moment,
GeoLocation location)
Calculates the position of moon at given moment and geographical location.
|
Moment |
Zodiac.Event.atMomentOfEntry(Moment start)
Calculates the moment when the celestial body enters the associated zodiac.
|
Moment |
Zodiac.Event.atMomentOfExit(Moment start)
Calculates the moment when the celestial body leaves the associated zodiac.
|
Moment |
MoonPhase.atOrAfter(Moment moment)
Obtains the first moon phase which is at or after given moment.
|
Moment |
MoonPhase.before(Moment 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 |
SolarTime.Sunshine.isPresent(Moment moment)
Is there any sunshine at given moment?
|
boolean |
LunarTime.Moonlight.isPresent(Moment moment)
Is the moon above the horizon at given moment?
|
static AstronomicalSeason |
AstronomicalSeason.of(Moment moment)
Determines the astronomical season related to given moment.
|
static JulianDay |
JulianDay.ofEphemerisTime(Moment moment)
Creates a Julian day on the time scale
TimeScale.TT,
sometimes also called Julian Ephemeris Day. |
static JulianDay |
JulianDay.ofMeanSolarTime(Moment moment)
Creates a Julian day on the time scale
TimeScale.UT,
hence related to the mean solar time. |
static JulianDay |
JulianDay.ofSimplifiedTime(Moment moment)
Creates a Julian day on the time scale
TimeScale.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 |
Zodiac.Event.test(Moment moment)
Tests if this event happens at given moment.
|
| Modifier and Type | Method and Description |
|---|---|
Moment |
NetTimeConnector.currentTime()
Yields the current time after a connection has been established
at least once.
|
Moment |
FixedClock.currentTime() |
Moment |
AdjustableClock.currentTime() |
Moment |
NetTimeConnector.getLastConnectionTime()
Yields the time of last connection.
|
| Constructor and Description |
|---|
DaytimeClock(String server,
ChronoParser<Moment> parser)
Creates a new instance which uses the given time server on the
port 13.
|
| Modifier and Type | Field and Description |
|---|---|
static 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 Type | Method and Description |
|---|---|
static 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(DisplayMode dateStyle,
DisplayMode timeStyle,
Locale locale,
TZID tzid)
|
static ChronoFormatter<Moment> |
ChronoFormatter.ofMomentStyle(FormatStyle dateStyle,
FormatStyle timeStyle,
Locale locale,
TZID tzid)
Constructs a style-based formatter for moments.
|
static <C extends CalendarVariant<C>> |
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.setUpWithOverride(Locale locale,
Chronology<C> overrideCalendar)
Constructs a builder for creating global formatters with usage of given calendar type.
|
| Modifier and Type | Field and Description |
|---|---|
static SimpleFormatter<Moment> |
SimpleFormatter.RFC_1123
Defines the RFC-1123-format which is for example used in mail headers (technical internet-timestamp).
|
| Modifier and Type | Method and Description |
|---|---|
static 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(DisplayMode dateStyle,
DisplayMode timeStyle,
Locale locale,
TZID tzid)
|
static SimpleFormatter<Moment> |
SimpleFormatter.ofMomentStyle(FormatStyle dateStyle,
FormatStyle timeStyle,
Locale locale,
TZID tzid)
Constructs a style-based formatter for global timestamp objects (moments).
|
| Modifier and Type | Method and Description |
|---|---|
static <I extends ChronoInterval<Moment>> |
IntervalTree.onMomentAxis(Collection<I> intervals)
Creates an interval tree on the moment axis (UTC) filled with given moment intervals.
|
| Modifier and Type | Method and Description |
|---|---|
Moment |
MomentInterval.getEndAsMoment()
Yields the end time point.
|
Moment |
MomentInterval.getStartAsMoment()
Yields the start time point.
|
Moment |
MomentInterval.random()
Obtains a random moment within this interval.
|
| Modifier and Type | Method and Description |
|---|---|
static 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.onMomentAxis(Collection<I> intervals)
Creates an interval tree on the moment axis (UTC) filled with given moment intervals.
|
Stream<Moment> |
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.
|
static Stream<Moment> |
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 Type | Method and Description |
|---|---|
static MomentInterval |
MomentInterval.between(Moment start,
Moment end)
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 |
MomentInterval.since(Moment start)
Creates an infinite half-open interval since given start.
|
static Stream<Moment> |
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 |
MomentInterval.until(Moment end)
Creates an infinite open interval until given end.
|
| Modifier and Type | Method and Description |
|---|---|
static 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> parser,
BracketPolicy policy)
Interpretes given text as interval.
|
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> startFormat,
char separator,
ChronoParser<Moment> endFormat,
BracketPolicy policy,
ParseLog status)
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.
|
Copyright © 2014–2021. All rights reserved.