//如excel 中2013-01-04 18:30:12 PM 解析后的这列cell 传入此方法 将返回 2013-01-04 18:30:12
public static String FormateTime(Cell formatecell) {
try {
java.util.Date mydate = null;
DateCell datecll = (DateCell) formatecell;
mydate = datecll.getDate();
long time = (mydate.getTime() / 1000) - 60 * 60 * 8;
mydate.setTime(time * 1000);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return formatter.format(mydate);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}