|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.util.TimeFormat
public class TimeFormat
A simple formatter for times. This formatter accepts a long time value (milliseconds) and optionally a style preference and returns a human-readable String representing the time.
By default the time is formatted using a the MEDIUM style. There are 2 other styles to choose from:
| Field Summary | |
|---|---|
static int |
LONG
Constant for long styles. |
static int |
MEDIUM
Constant for medium styles. |
static int |
SHORT
Constant for short styles. |
| Constructor Summary | |
|---|---|
TimeFormat()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
format(long time,
int style,
java.util.Locale locale)
Formats the millisecond value using the specified style. |
static java.lang.String |
format(long time,
java.util.Locale locale)
Formats the millisecond value with a style of MEDIUM. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SHORT
public static final int MEDIUM
public static final int LONG
| Constructor Detail |
|---|
public TimeFormat()
| Method Detail |
|---|
public static java.lang.String format(long time,
java.util.Locale locale)
MEDIUM. The given long value must be positive.
time - the millisecond time value to format. Must be positive.
public static java.lang.String format(long time,
int style,
java.util.Locale locale)
SHORT, MEDIUM,
or LONG then an IllegalArgumentException will be thrown. The given long value must be positive as well.
time - the millisecond time value to format. Must be positive.style - the desired formatting style.
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||