Java Utililty Methods Locale Format

List of utility methods to do Locale Format

Description

The list of methods to do Locale Format are organized into topic(s).

Method

StringformatDate(Date date, String pPatern)
Format a date as returned for producing a portable player readable date.
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US);
try {
    SimpleDateFormat simpleFormatter = (SimpleDateFormat) formatter;
    simpleFormatter.applyPattern(pPatern);
    String result = simpleFormatter.format(date);
    return result;
} catch (Exception e) {
return "";
StringformatDate(Date value, String pattern, TimeZone tz)
format the date with the given pattern.
if (value == null) {
    return "";
SimpleDateFormat formater = new SimpleDateFormat(pattern, Locale.US);
if (tz != null) {
    formater.setTimeZone(tz);
return formater.format(value);
...
StringformatDate(final Date dat, final String pattern)
Formate Date according to Patter and Locale of US
return formatDate(dat, pattern, Locale.US);
StringformatDate(final Date date, final String datepattern, TimeZone tz)
getDateCUBRIDString
final DateFormat formatter = new SimpleDateFormat(datepattern, Locale.US);
formatter.setTimeZone(tz);
formatter.setLenient(false);
return formatter.format(date);
StringformatDate(final Date date, final String format)
Formats date in accordance with given format
return new SimpleDateFormat(format, Locale.US).format(date);
StringformatDate(final Date date, final String pattren)
Format date.
final SimpleDateFormat formatter = new SimpleDateFormat(pattren, new Locale("en", "US"));
if (date == null) {
    return "";
return formatter.format(date);
StringformatDate(java.util.Date d, String format)
Format date using a mask and the default locale
SimpleDateFormat f = new SimpleDateFormat();
f.applyPattern(format);
return f.format(d);
StringformatDate(java.util.Date d, String format)
format Date
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(d);
StringformatDate(java.util.Date date, String formatPattern)
formatDate Returns the formatted date according to the input pattern.
if (date == null) {
    return "";
java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(formatPattern,
        new java.util.Locale("en", "US"));
return (formatter.format(date));
DateformatDate(String _Date)
format Date
if (_Date == null)
    return new Date();
SimpleDateFormat _SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.SIMPLIFIED_CHINESE);
return _SimpleDateFormat.parse(_Date);