Gsonの日付形式が異常です-com.google.gson.JsonSyntaxException



Gson Date Format Abnormal Com



Gsonはタイムスタンプ形式の問題が発生しました

Gson gson = new GsonBuilder() .registerTypeAdapter(Timestamp.class,new TimestampTypeAdapter()) .setDateFormat('yyyy-MM-dd HH:mm:ss') .create() String newValue = gson.toJson(System.currentTimeMillis())

Gson使用日付フォーマットの問題が発生しました



Gson gson = new GsonBuilder() .setDateFormat('yyyy-MM-dd HH:mm:ss') .create() String newValue = gson.toJson(new Date(System.currentTimeMillis()),Date.class)