日期:2014-05-20 浏览次数:20771 次
public class FormatUtil {
private final static SimpleDateFormat SDF_DATE = new SimpleDateFormat("yyyy-MM-dd");
private final static SimpleDateFormat SDF_TIME = new SimpleDateFormat("HH:mm:ss");
private final static SimpleDateFormat SDF_DB_DATE = new SimpleDateFormat("yyyyMMdd");
public static String getDateTime(Date date){
return SDF_DATE.format(date) + " " + SDF_TIME.format(date);
}
public static String getDateTime1(Date date){
return SDF_DATE.format(date) ;
}
public static String getDate(Date date) {
return SDF_DATE.format(date);
}
public static String getDBDate(Date date){
return SDF_DB_DATE.format(date);
}
}