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