public class DateUtil
extends java.lang.Object
Utility class to handle some date format logic.
Constructor and Description |
---|
DateUtil() |
Modifier and Type | Method and Description |
---|---|
static java.text.DateFormat |
getDateFormat(java.lang.String pattern,
java.util.Locale locale)
Create a DateFormat object by using a Locale and a pattern.
|
static java.text.DateFormat |
getDateFormat(java.lang.String pattern,
java.util.Locale locale,
java.util.TimeZone tzone)
Create a DateFormat object by using a Locale, a TimeZone and a pattern.
|
static java.util.Locale |
parseLocale(java.lang.String str)
To parse a string to Local object.
|
public static java.util.Locale parseLocale(java.lang.String str)
str
- the string.java.lang.IllegalArgumentException
- if the string is not in the right format.public static java.text.DateFormat getDateFormat(java.lang.String pattern, java.util.Locale locale)
pattern
- the pattern.locale
- the Locale object.public static java.text.DateFormat getDateFormat(java.lang.String pattern, java.util.Locale locale, java.util.TimeZone tzone)
pattern
- the pattern.locale
- the Locale object.tzone
- the TimeZone object.