| 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 Normalizer<CalendarUnit> |
Duration.STD_CALENDAR_PERIOD
Normalizes the calendrical items of a duration on the base
1 year = 12 months - without converting the days to months. |
static TemporalType<Period,Duration<CalendarUnit>> |
TemporalType.THREETEN_PERIOD
Bridge between the JSR-310-class
java.time.Period and
the class net.time4j.Duration. |
| Modifier and Type | Method and Description |
|---|---|
<T extends TimePoint<? super CalendarUnit,T>> |
CalendarUnit.between(T start,
T end)
Calculates the temporal distance between given calendar dates
in this calendar unit.
|
| Modifier and Type | Method and Description |
|---|---|
static CalendarUnit |
CalendarUnit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CalendarUnit[] |
CalendarUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static Duration<CalendarUnit> |
Duration.from(Period threetenPeriod)
Short cut for
TemporalType.THREETEN_PERIOD.translate(threetenPeriod). |
static TimeMetric<CalendarUnit,Duration<CalendarUnit>> |
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.
|
static TimeMetric<CalendarUnit,Duration<CalendarUnit>> |
Duration.inYearsMonthsDays()
Constructs a metric in years, months and days.
|
Duration<CalendarUnit> |
PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days.
|
static Duration<CalendarUnit> |
Duration.ofCalendarUnits(int years,
int months,
int days)
Creates a positive duration in years, months and days.
|
static Duration<CalendarUnit> |
Duration.parseCalendarPeriod(String period)
Parses a canonical representation with only date units to a
calendrical duration.
|
Duration<CalendarUnit> |
Duration.toCalendarPeriod()
Extracts a new duration with all contained calendar units only.
|
| Modifier and Type | Method and Description |
|---|---|
String |
PrettyTime.print(long amount,
CalendarUnit unit,
TextWidth width)
Formats given duration in calendar units.
|
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. |
PrettyTime |
PrettyTime.withEmptyUnit(CalendarUnit emptyUnit)
Defines the time unit used for formatting an empty duration.
|
| Modifier and Type | Method and Description |
|---|---|
static Duration<IsoUnit> |
Duration.compose(Duration<CalendarUnit> calendarPeriod,
Duration<ClockUnit> clockPeriod)
Creates a composition of a calendar period and a clock period.
|
Duration<CalendarUnit> |
PlainDate.normalize(TimeSpan<? extends CalendarUnit> timespan)
Normalized given timespan using years, months and days.
|
Copyright © 2014–2015. All rights reserved.