public final class FormatUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
formatDateString(String dateString,
String fromFormat,
Locale fromLocale,
String toFormat,
Locale toLocale,
String fieldName)
Formats a string representation of a date, into another string date
format.
|
static String |
formatDateString(String dateString,
String fromFormat,
String toFormat)
Formats a string representation of a date, into another string date
format.
|
static String |
formatDateString(String dateString,
String fromFormat,
String toFormat,
String fieldName)
Formats a string representation of a date, into another string date
format.
|
public static String formatDateString(String dateString, String fromFormat, String toFormat)
dateString
- the date to formatfromFormat
- source format (null
means EPOCH)toFormat
- target format (null
means EPOCH)null
if unable to formatpublic static String formatDateString(String dateString, String fromFormat, String toFormat, String fieldName)
dateString
- the date to formatfromFormat
- source formattoFormat
- target formatfieldName
- optional field name for referencing in error messagespublic static String formatDateString(String dateString, String fromFormat, Locale fromLocale, String toFormat, Locale toLocale, String fieldName)
dateString
- the date to formatfromFormat
- source formatfromLocale
- source format localetoFormat
- target formattoLocale
- target format localefieldName
- optional field name for referencing in error messagesCopyright © 2009–2021 Norconex Inc.. All rights reserved.