Skip to content

Commit 17e03c9

Browse files
review
1 parent 90e1ac8 commit 17e03c9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/src/main/java/com/cloud/serializer/GsonHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public class GsonHelper {
5050
protected static final Gson s_gson;
5151
protected static final Gson s_gogger;
5252

53+
public static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
54+
5355
static {
5456
GsonBuilder gsonBuilder = new GsonBuilder();
5557
s_gson = setDefaultGsonConfig(gsonBuilder);
@@ -78,7 +80,7 @@ static Gson setDefaultGsonConfig(GsonBuilder builder) {
7880
}.getType(), new NwGroupsCommandTypeAdaptor());
7981
builder.registerTypeAdapter(Storage.StoragePoolType.class, new StoragePoolTypeAdaptor());
8082
builder.registerTypeAdapter(Hypervisor.HypervisorType.class, new HypervisorTypeAdaptor());
81-
builder.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
83+
builder.setDateFormat(DATE_FORMAT);
8284
Gson gson = builder.create();
8385
dsAdaptor.initGson(gson);
8486
dtAdaptor.initGson(gson);

server/src/main/java/com/cloud/server/StatsCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public String toString() {
294294
private static StatsCollector s_instance = null;
295295

296296
private static Gson gson = new GsonBuilder()
297-
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
297+
.setDateFormat(GsonHelper.DATE_FORMAT)
298298
.create();
299299

300300
private ScheduledExecutorService _executor = null;

0 commit comments

Comments
 (0)