Deprecated
ICU 56 Use MeasureFormat or RelativeDateTimeFormatter instead.
Use MeasureFormat to format periods like "5 days, 3 hours"; use RelativeDateTimeFormatter to format relative dates like "5 days ago".
MeasureFormat, RelativeDateTimeFormatter
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract StringBuffer | Returns: the toAppend bufferthe object to format. Should be either a Long, Date, or javax.xml.datatype.Duration object. object, StringBuffer the buffer to append to toAppend, FieldPosition the field position, may contain additional error messages. pos)Implements abstract java.
Deprecated
ICU 56
Format an arbitrary object.
|
| public abstract String | Returns: the formatted timethe duration in milliseconds duration, long the date from which to compute the duration referenceDate)
Deprecated
ICU 56
Formats a duration expressed in milliseconds from a reference date.
|
| public abstract String | Returns: the formatted timethe duration in milliseconds duration)
Deprecated
ICU 56
Formats a duration expressed in milliseconds.
|
| public abstract String | Returns: the formatted timethe ending date targetDate)
Deprecated
ICU 56
Formats the duration between now and a target date.
|
| public static DurationFormat | |
| public Object | parseObject(String
A source, ParsePosition String, part of which should be parsed.A pos)ParsePosition object with index and error
index information as described above.Implements abstract java.
Deprecated
ICU 56
DurationFormat cannot parse, by default.
|
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| DurationFormat | back to summary |
|---|---|
| protected DurationFormat()
Deprecated This API is ICU internal only. Subclass interface
| |
| DurationFormat | back to summary |
|---|---|
| protected DurationFormat(ULocale locale)
Deprecated This API is ICU internal only. Subclass interface
| |
| format | back to summary |
|---|---|
| public abstract StringBuffer format(Object object, StringBuffer toAppend, FieldPosition pos) Implements abstract java. Deprecated ICU 56 Format an arbitrary object. Defaults to a call to formatDurationFromNow() for either Long or Date objects.
| |
| formatDurationFrom | back to summary |
|---|---|
| public abstract String formatDurationFrom(long duration, long referenceDate)
Deprecated ICU 56 Formats a duration expressed in milliseconds from a reference date. The reference date allows formatters to use actual durations of variable-length periods (like months) if they wish. The duration is expressed as the number of milliseconds in the past (negative values) or future (positive values) with respect to a reference date (expressed as milliseconds in epoch).
| |
| formatDurationFromNow | back to summary |
|---|---|
| public abstract String formatDurationFromNow(long duration)
Deprecated ICU 56 Formats a duration expressed in milliseconds. This is a convenience method that calls formatDurationFrom using the current system time as the reference date.
| |
| formatDurationFromNowTo | back to summary |
|---|---|
| public abstract String formatDurationFromNowTo(Date targetDate)
Deprecated ICU 56 Formats the duration between now and a target date.
This is a convenience method that calls
formatDurationFrom(long, long) using now
as the reference date, and the difference between now and
| |
| getInstance | back to summary |
|---|---|
| public static DurationFormat getInstance(ULocale locale)
Deprecated ICU 56 Construct a duration format for the specified locale
| |
| parseObject | back to summary |
|---|---|
| public Object parseObject(String source, ParsePosition pos) Implements abstract java. Deprecated ICU 56 DurationFormat cannot parse, by default. This method will throw an UnsupportedOperationException.
| |