Methods Summary |
---|
public static java.lang.String | formatDate(java.util.Date date, java.lang.String format)Formats the given Date into the given date pattern.
if (date == null || format == null)
throw new IllegalArgumentException(
"given parameters must not be null");
SimpleDateFormat inst = formater.getFormater();
inst.applyPattern(format);
try{
return inst.format(date);
}finally{
formater.returnFomater(inst);
}
|
protected java.text.SimpleDateFormat | getFormater()
if (this.objectStack.empty())
return new SimpleDateFormat(DateFormater.HTTP_HEADER_DATE_FORMAT,Locale.ENGLISH);
return this.objectStack.pop();
|
public static java.util.Date | parseDate(java.lang.String date, java.lang.String formates)Parses the given string into one of the specified formates
for (int i = 0; i < formates.length; i++) {
try {
return parseDate(date,formates[i]);
} catch (ParseException e) {
//
}
}
throw new ParseException("Unparseable date: "+date,0);
|
public static java.util.Date | parseDate(java.lang.String dateString, java.lang.String pattern)Parses the given string into the specified formate
if(dateString == null|| pattern == null)
throw new IllegalArgumentException(
"given parameters must not be null");
SimpleDateFormat inst = formater.getFormater();
try{
inst.applyPattern(pattern);
return inst.parse(dateString);
}finally{
formater.returnFomater(inst);
}
|
protected void | returnFomater(java.text.SimpleDateFormat format)
if (this.objectStack.size() <= 25)
this.objectStack.push(format);
|