public final class DateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TIME_ZONE |
static String |
ISO_8601_FORMAT |
Modifier and Type | Method and Description |
---|---|
static DateFormat |
createIso8601DateFormat()
Creates and returns a new instance of DateFormat with pattern ISO-8601.
|
static String |
getIso8601String(Date input)
Returns an ISO-8601 formatted string of the given date.
|
static boolean |
isIso8601Format(String dateString)
Checks if the specified date string represents a date in ISO-8601 format.
|
static Date |
parseIso8601(String input)
Formats the given string using the ISO-8601 format.
|
static Date |
parseIso8601checked(String input)
Formats the given string using the ISO-8601 format and throws a checked exception if the parsing fails.
|
public static final String ISO_8601_FORMAT
public static final String DEFAULT_TIME_ZONE
public static Date parseIso8601(String input)
input
- the string to parse into a DateRuntimeException
- thrown if the given input does not match the expected ISO-8601 formatpublic static Date parseIso8601checked(String input) throws ParseException
input
- the string to parse into a DateParseException
- thrown if the given input does not match the expected ISO-8601 formatpublic static DateFormat createIso8601DateFormat()
public static String getIso8601String(Date input)
input
- the Date
to convert into an ISO-8601 stringpublic static boolean isIso8601Format(String dateString)
dateString
- - does not check null value, length is fixed to 24 charsCopyright © 2010 - 2017 edorasware ag. All Rights Reserved.