File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/com/meilisearch/sdk/json Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1212import java .util .ArrayList ;
1313import java .util .Date ;
1414import java .util .List ;
15+ import java .util .TimeZone ;
1516
1617public class GsonKeyTypeAdapter extends TypeAdapter <Key > {
1718
@@ -24,7 +25,13 @@ public class GsonKeyTypeAdapter extends TypeAdapter<Key> {
2425 private static final String KEY_EXPIRES_AT = "expiresAt" ;
2526 private static final String KEY_CREATED_AT = "createdAt" ;
2627 private static final String KEY_UPDATED_AT = "updatedAt" ;
27- private static final DateFormat DATE_FORMAT = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss'Z'" );
28+ private static final DateFormat DATE_FORMAT = createUtcDateFormat ();
29+
30+ private static DateFormat createUtcDateFormat () {
31+ SimpleDateFormat format = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss'Z'" );
32+ format .setTimeZone (TimeZone .getTimeZone ("UTC" ));
33+ return format ;
34+ }
2835
2936 @ Override
3037 public void write (JsonWriter writer , Key key ) throws IOException {
You can’t perform that action at this time.
0 commit comments