/**
* 将CST的时间字符串转换成需要的日期格式字符串<br>
*
* @param cststr
* The source to be dealed with. <br>
* (exp:Fri Jan 02 00:00:00 CST 2009)
* @param fmt
* The format string
* @return string or <code>null</code> if the cststr is unpasrseable or is
* null return null,else return the string.
* @author HitSnail
*/
public static String getDateFmtStrFromCST(String cststr, String fmt) {
if ((null == cststr) || (null == fmt)) {
return null;
}
String str = null;
SimpleDateFormat sdfy = new SimpleDateFormat(fmt.trim());
SimpleDateFormat sdf = new SimpleDateFormat(
"EEE MMM dd HH:mm:ss 'CST' yyyy", Locale.US);
try {
str = sdfy.format(sdf.parse(cststr.trim()));
} catch (ParseException e) {
e.printStackTrace();
return null;
}
return str;
}