| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| 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 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]]]X".
|
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]]]XXX".
|
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 |
PlainTimestamp.atUTC()
Combines this local timestamp with the timezone offset UTC+00:00
to a global UTC-moment.
|
Moment |
SystemClock.currentTime() |
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 |
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> duration)
Subtracts the given machine time duration in SI-seconds from this
moment.
|
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(MachineTime<SI> duration)
Adds the given machine time duration in SI-seconds to this
moment.
|
Moment |
ZonalMoment.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 ChronoFormatter<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 ChronoFormatter<Moment> |
Moment.formatter(String formatPattern,
ChronoPattern 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 ChronoFormatter<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 ChronoFormatter<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 ChronoFormatter<Moment> |
Moment.localFormatter(String formatPattern,
ChronoPattern patternType)
Creates a new formatter which uses the given pattern in the
default locale for formatting and parsing UTC-timestamps.
|
| 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 ZonalMoment |
ZonalMoment.parse(String text,
ChronoParser<Moment> parser)
Parses given text to a
ZonalMoment. |
String |
ZonalMoment.print(ChronoPrinter<Moment> printer)
Creates a formatted output of this instance.
|
Copyright © 2014. All rights reserved.