将配置转换时间的时区设置由写死改成提到配置文件中

This commit is contained in:
wangxin
2018-06-11 17:10:20 +08:00
parent 61714cd338
commit 80381c2eb2
3 changed files with 8 additions and 2 deletions

View File

@@ -255,7 +255,7 @@ public abstract class BaseService {
public JsonElement serialize(Date src, Type type,
JsonSerializationContext context) {
String format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
long time= ((Date) src).getTime()-8*60*60*1000;
long time= ((Date) src).getTime()-Constants.TIME_ZONE*60*60*1000;
SimpleDateFormat sdf = new SimpleDateFormat(format);
return new JsonPrimitive(sdf.format(time));
}