public class DateTimeFormat
extends java.lang.Object
| Constructor and Description |
|---|
DateTimeFormat() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatDate(long timestamp)
Returns a formatted date.
|
static java.lang.String |
formatDateTime(long dateTime)
Format the given timestamp either as absolute date or a relative time,
depending on the signature of the value.
|
static java.lang.String |
formatTime(long time)
Returns a formatted string representing the relative time.
|
public static java.lang.String formatDateTime(long dateTime)
dateTime - public static java.lang.String formatTime(long time)
String.format("%2$sw %1$tHh %1$tMmin %1$tSs %1$tLms", timestamp, timestamp/1000/60/60/24/7).
but without leading zeros.time - public static java.lang.String formatDate(long timestamp)
String.format("%1$tc", timestamp).timestamp -