public class DateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ISO_8601_DATE_PATTERN |
static String |
ISO_8601_UTC_TIMESTAMP_PATTERN |
static List<String> |
isoLanguageCodes |
static Locale |
NULL_LOCALE |
static String |
UTC_TIMEZONE_IDENTIFIER |
Constructor and Description |
---|
DateUtils() |
Modifier and Type | Method and Description |
---|---|
static DateFormat |
getDateFormatter(String pattern)
Returns a date formatter for a provided date or date/time pattern.
|
static DateFormat |
getDateFormatter(String pattern,
Locale locale)
Returns a date formatter for a supplied date or date/time pattern,
in the supplied locale (if any).
|
static String |
getDayOfMonth(Object millis) |
static Locale |
getLocale(String lang)
Returns the locale associated with a supplied ISO 639-1 language code.
|
String |
getMonthName(Object millis) |
static boolean |
isParseableByDatePattern(String str,
String pattern)
Identifies whether a presumptive date or date/time can be parsed
by a date parser, using a supplied format pattern.
|
static void |
main(String[] args) |
static Date |
parseDate(String str,
DateFormat df)
Parses a presumptive date or date/time, using a supplied format pattern.
|
static Date |
parseDate(String str,
String pattern)
Parses a presumptive date or date/time, using a supplied format pattern.
|
static TimeZone |
UTCTimeZone()
Returns the UTC time zone.
|
public static final String ISO_8601_DATE_PATTERN
public static final String UTC_TIMEZONE_IDENTIFIER
public static final String ISO_8601_UTC_TIMESTAMP_PATTERN
public static final Locale NULL_LOCALE
public static TimeZone UTCTimeZone()
public static Date parseDate(String str, String pattern)
str
- a String, possibly a date or date/time String.pattern
- A date or date/time pattern.public static Date parseDate(String str, DateFormat df)
str
- a String, possibly a date or date/time String.df
- A date formatter.public static Locale getLocale(String lang)
lang
- A language code.public static DateFormat getDateFormatter(String pattern)
pattern
- A date or date/time pattern.public static DateFormat getDateFormatter(String pattern, Locale locale)
pattern
- A date or date/time pattern.locale
- A locale.public static boolean isParseableByDatePattern(String str, String pattern)
str
- a String, possibly a date or date/time String.pattern
- A date or date/time pattern.public static void main(String[] args)
Copyright © 2016. All rights reserved.