调整转换json方法,由UTC时间格式改为正常时间格式,去掉减去对应时区时间
This commit is contained in:
@@ -254,8 +254,8 @@ public abstract class BaseService {
|
|||||||
@Override
|
@Override
|
||||||
public JsonElement serialize(Date src, Type type,
|
public JsonElement serialize(Date src, Type type,
|
||||||
JsonSerializationContext context) {
|
JsonSerializationContext context) {
|
||||||
String format = "yyyy-MM-dd'T'HH:mm:ss.SSS";
|
String format = "yyyy-MM-dd HH:mm:ss";
|
||||||
long time= ((Date) src).getTime()-Constants.TIME_ZONE*60*60*1000;
|
long time= ((Date) src).getTime();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||||
return new JsonPrimitive(sdf.format(time));
|
return new JsonPrimitive(sdf.format(time));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user