Authored by Lixiaodi

Merge branch 'master' of http://git.yoho.cn/ufo/ufo-platform

... ... @@ -3,43 +3,16 @@ package com.yoho.ufo.service.model;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by yoho on 2017/2/15.
*/
public class BaseBO implements Serializable {
public static final String NORMAL_FORMAT = "yyyy-MM-dd";
private static final long serialVersionUID = 1759153128139236954L;
private static final long serialVersionUID = 2713604434915399057L;
public BaseBO() {
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
public static String getDateFormatFromInt(long intTime, String... formats) {
if(intTime <= 0L) {
return null;
} else {
Date date = new Date(intTime * 1000L);
return getDateFormatFromDate(date, formats);
}
}
public static String getDateFormatFromDate(Date date, String... formats) {
if(date == null) {
return null;
} else {
String format = "yyyy-MM-dd";
if(null != formats && formats.length > 0) {
format = null == formats[0]?"yyyy-MM-dd":formats[0];
}
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
}
}
}
\ No newline at end of file
... ...