public final class AmountFormats extends Object
This allows a TemporalAmount, such as Duration or Period,
to be formatted. Only selected formatting options are provided.
| Modifier and Type | Method | Description |
|---|---|---|
static String |
iso8601(Period period,
Duration duration) |
Formats a period and duration to a string in ISO-8601 format.
|
static String |
wordBased(Duration duration,
Locale locale) |
Formats a duration to a string in a localized word-based format.
|
static String |
wordBased(Period period,
Duration duration,
Locale locale) |
Formats a period and duration to a string in a localized word-based format.
|
static String |
wordBased(Period period,
Locale locale) |
Formats a period to a string in a localized word-based format.
|
public static String iso8601(Period period, Duration duration)
To obtain the ISO-8601 format of a Period or Duration
individually, simply call toString().
See also PeriodDuration.
period - the period to formatduration - the duration to formatpublic static String wordBased(Period period, Locale locale)
This returns a word-based format for the period.
The words are configured in a resource bundle text file -
org.threeten.extra.wordbased.properties - with overrides per language.
period - the period to formatlocale - the locale to usepublic static String wordBased(Duration duration, Locale locale)
This returns a word-based format for the duration.
The words are configured in a resource bundle text file -
org.threeten.extra.wordbased.properties - with overrides per language.
duration - the duration to formatlocale - the locale to usepublic static String wordBased(Period period, Duration duration, Locale locale)
This returns a word-based format for the period.
The words are configured in a resource bundle text file -
org.threeten.extra.wordbased.properties - with overrides per language.
period - the period to formatduration - the duration to formatlocale - the locale to useCopyright © 2010–2019 ThreeTen.org. All rights reserved.