public enum DateFormat extends java.lang.Enum<DateFormat>
| Enum Constant and Description |
|---|
DMY_DASH |
DMY_PERIOD |
DMY_SLASH |
MDY_DASH |
MDY_PERIOD |
MDY_SLASH |
YMD_DASH |
YMD_PERIOD |
YMD_SLASH |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(DateTime dateTime) |
java.lang.String |
formatRelative(DateTime referenceDateTime,
DateTime dateTime)
Formats a dateTime based on a referenceDateTime.
|
static DateFormat |
forOrderAndSeparator(java.lang.String order,
char separator)
Returns the format for the given fields order (which may be "DMY", "MDY" or "YMD") and separator char, or throws
IllegalArgumentException if there's no match |
java.lang.String |
getPattern() |
static DateFormat |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static DateFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DateFormat DMY_SLASH
public static final DateFormat DMY_DASH
public static final DateFormat DMY_PERIOD
public static final DateFormat MDY_SLASH
public static final DateFormat MDY_DASH
public static final DateFormat MDY_PERIOD
public static final DateFormat YMD_SLASH
public static final DateFormat YMD_DASH
public static final DateFormat YMD_PERIOD
public static DateFormat[] values()
for (DateFormat c : DateFormat.values()) System.out.println(c);
public static DateFormat valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static DateFormat forOrderAndSeparator(java.lang.String order, char separator)
IllegalArgumentException if there's no matchpublic java.lang.String format(DateTime dateTime)
public java.lang.String formatRelative(DateTime referenceDateTime, DateTime dateTime)
public java.lang.String getPattern()