| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.format |
Defines common interfaces for any format support of Time4J.
|
| Modifier and Type | Method and Description |
|---|---|
static TemporalFormatter<PlainTime> |
PlainTime.formatter(DisplayMode mode,
Locale locale)
Creates a new formatter which uses the given display mode and locale
for formatting and parsing plain times.
|
static TemporalFormatter<PlainDate> |
PlainDate.formatter(DisplayMode mode,
Locale locale)
Creates a new formatter which uses the given display mode and locale
for formatting and parsing plain dates.
|
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>> |
PlainTimestamp.formatter(String formatPattern,
P patternType,
Locale locale)
Creates a new formatter which uses the given pattern and locale
for formatting and parsing plain timestamps.
|
static <P extends ChronoPattern<P>> |
PlainTime.formatter(String formatPattern,
P patternType,
Locale locale)
Creates a new formatter which uses the given pattern and locale
for formatting and parsing plain times.
|
static <P extends ChronoPattern<P>> |
PlainDate.formatter(String formatPattern,
P patternType,
Locale locale)
Creates a new formatter which uses the given pattern and locale
for formatting and parsing plain dates.
|
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.
|
static TemporalFormatter<PlainTime> |
PlainTime.localFormatter(DisplayMode mode)
Creates a new formatter which uses the given display mode in the
default locale for formatting and parsing plain times.
|
static TemporalFormatter<PlainDate> |
PlainDate.localFormatter(DisplayMode mode)
Creates a new formatter which uses the given display mode in the
default locale for formatting and parsing plain dates.
|
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>> |
PlainTimestamp.localFormatter(String formatPattern,
P patternType)
Creates a new formatter which uses the given pattern in the
default locale for formatting and parsing plain timestamps.
|
static <P extends ChronoPattern<P>> |
PlainTime.localFormatter(String formatPattern,
P patternType)
Creates a new formatter which uses the given pattern in the
default locale for formatting and parsing plain times.
|
static <P extends ChronoPattern<P>> |
PlainDate.localFormatter(String formatPattern,
P patternType)
Creates a new formatter which uses the given pattern in the
default locale for formatting and parsing plain dates.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.printRelativeOrDate(PlainDate date,
TZID tzid,
CalendarUnit maxRelativeUnit,
TemporalFormatter<PlainDate> formatter)
Formats given date relative to the current date of
PrettyTime.getReferenceClock()
as duration or as absolute date. |
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 |
|---|---|
<T extends ChronoEntity<T>> |
FormatEngine.create(Class<T> chronoType,
String formatPattern,
P patternType,
Locale locale)
Creates a new temporal format object applicable on given chronological type.
|
TemporalFormatter<? extends UniversalTime> |
FormatEngine.createRFC1123()
Creates a specialized formatter for RFC-1123.
|
TemporalFormatter<T> |
TemporalFormatter.with(Leniency leniency)
Sets the leniency mode.
|
TemporalFormatter<T> |
TemporalFormatter.with(Locale locale)
Creates a copy of this formatter with given locale.
|
TemporalFormatter<T> |
TemporalFormatter.withTimezone(String tzid)
Equivalent to
withTimezone(Timezone.of(tzid).getID()). |
TemporalFormatter<T> |
TemporalFormatter.withTimezone(TZID tzid)
Creates a copy of this formatter with given timezone id which
shall be used in formatting or parsing.
|
Copyright © 2014–2017. All rights reserved.