public final class DateFormatUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DAY |
static long |
DAY_FACTOR |
static long |
HOUR |
static long |
MINUTE |
static long |
MONTH |
static long |
SECOND |
static long |
WEEK |
static long |
YEAR |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatAboutDialogDate(java.util.Date date) |
static java.lang.String |
formatAboutDialogDate(long time) |
static java.lang.String |
formatBetweenDates(long d1,
long d2) |
static java.lang.String |
formatDate(java.util.Date time) |
static java.lang.String |
formatDate(long time) |
static java.lang.String |
formatDateTime(java.util.Date date) |
static java.lang.String |
formatDateTime(long time) |
static java.lang.String |
formatFrequency(long time) |
static java.lang.String |
formatPrettyDate(java.util.Date date) |
static java.lang.String |
formatPrettyDate(long time) |
static java.lang.String |
formatPrettyDateTime(java.util.Date date) |
static java.lang.String |
formatPrettyDateTime(long time) |
static java.lang.String |
formatTime(java.util.Date time) |
static java.lang.String |
formatTime(long time) |
static java.lang.String |
formatTimeWithSeconds(java.util.Date time) |
static java.lang.String |
formatTimeWithSeconds(long time) |
static SyncDateFormat |
getDateFormat() |
static SyncDateFormat |
getDateTimeFormat() |
static long |
getDifferenceInDays(java.util.Date startDate,
java.util.Date endDate) |
static SyncDateFormat |
getIso8601Format() |
static java.util.Date |
getSampleDateTime()
Return sample date, that can be used to determine preferred string width.
|
static SyncDateFormat |
getTimeFormat() |
static SyncDateFormat |
getTimeWithSecondsFormat() |
static boolean |
isPrettyFormattingPossible(long time) |
public static final long SECOND
public static final long MINUTE
public static final long HOUR
public static final long DAY
public static final long WEEK
public static final long MONTH
public static final long YEAR
public static final long DAY_FACTOR
public static long getDifferenceInDays(java.util.Date startDate, java.util.Date endDate)
public static SyncDateFormat getDateFormat()
public static SyncDateFormat getTimeFormat()
public static SyncDateFormat getTimeWithSecondsFormat()
public static SyncDateFormat getDateTimeFormat()
public static SyncDateFormat getIso8601Format()
public static java.lang.String formatTime(java.util.Date time)
public static java.lang.String formatTime(long time)
public static java.lang.String formatTimeWithSeconds(java.util.Date time)
public static java.lang.String formatTimeWithSeconds(long time)
public static java.lang.String formatDate(java.util.Date time)
public static java.lang.String formatDate(long time)
public static java.lang.String formatPrettyDate(java.util.Date date)
public static java.lang.String formatPrettyDate(long time)
public static java.lang.String formatDateTime(java.util.Date date)
public static java.lang.String formatDateTime(long time)
public static java.lang.String formatPrettyDateTime(java.util.Date date)
public static java.lang.String formatPrettyDateTime(long time)
public static boolean isPrettyFormattingPossible(long time)
public static java.lang.String formatFrequency(long time)
public static java.lang.String formatBetweenDates(long d1, long d2)
public static java.lang.String formatAboutDialogDate(java.util.Date date)
public static java.lang.String formatAboutDialogDate(long time)
public static java.util.Date getSampleDateTime()
We should not use new Date()
to ensure results are reproducible (and to avoid "Today" for pretty formats).
Returned date is expected to return maximum width string for date formats like "d.m.yy H:M".