public static enum Parsers.DateParser extends Enum<Parsers.DateParser>
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
Date |
parse(String text)
Will try to parse the date with Locale.US and formats as follows:
yyyy-MM-dd HH:mm:ss.SSS, yyyy-MM-dd HH:mm:ss and yyyy-MM-dd
|
Date |
parse(String text,
String format)
Parse the text with the format specified and Locale.US
|
Date |
parse(String text,
String format,
Locale locale)
Parse the text with the format and locale specified
|
static Parsers.DateParser |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Parsers.DateParser[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Parsers.DateParser INSTANCE
public static Parsers.DateParser[] values()
for (Parsers.DateParser c : Parsers.DateParser.values()) System.out.println(c);
public static Parsers.DateParser valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Date parse(String text) throws ParserException
text - the text to parseParserException - if the text cannot be parsedpublic Date parse(String text, String format) throws ParserException
text - the text to parseformat - the date format, see SimpleDateFormat for more informationParserException - if the text cannot be parsedpublic Date parse(String text, String format, Locale locale) throws ParserException
text - the text to parseformat - the date format, see SimpleDateFormat for more informationlocale - the localeParserException - if the text cannot be parsedCopyright © 2022 Ctrip, Inc.. All rights reserved.