| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.sql |
Bridge to JDBC.
|
| 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.
|
Moment |
ZonalClock.currentMoment()
Equivalent to the expression
now().inStdTimezone(). |
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(RealTime<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). |
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(RealTime<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.
|
static TemporalFormatter<Moment> |
Moment.formatter(DisplayMode mode,
Locale locale,
TZID tzid)
Creates a new formatter which uses the given display mode and locale
for formatting and parsing moments in given timezone.
|
static <P extends ChronoPattern<P>> |
Moment.formatter(String formatPattern,
P patternType,
Locale locale,
TZID tzid)
Creates a new formatter which uses the given pattern and locale
for formatting and parsing moments in given timezone.
|
static TemporalFormatter<Moment> |
Moment.formatterRFC1123()
Defines the RFC-1123-format which is for example used in mail
headers.
|
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 TemporalFormatter<Moment> |
Moment.localFormatter(DisplayMode mode)
Creates a new formatter which uses the given display mode in the
default locale for formatting and parsing UTC-timestamps.
|
static <P extends ChronoPattern<P>> |
Moment.localFormatter(String formatPattern,
P patternType)
Creates a new formatter which uses the given pattern in the
default locale for formatting and parsing UTC-timestamps.
|
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 ZonalDateTime |
ZonalDateTime.parse(String text,
TemporalFormatter<Moment> parser,
ParsePosition position)
Parses given text to a
ZonalDateTime. |
String |
ZonalDateTime.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 | Field and Description |
|---|---|
static JDBCAdapter<Timestamp,Moment> |
JDBCAdapter.SQL_TIMESTAMP_WITH_ZONE
Bridge between a JDBC-Timestamp and the class
Moment. |
Copyright © 2014–2017. All rights reserved.