mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
return date format as UTC in APIs
This commit is contained in:
parent
475b832c59
commit
9aa5f2793f
@ -40,6 +40,7 @@ import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
|
|||||||
@Consumes(APPLICATION_JSON)
|
@Consumes(APPLICATION_JSON)
|
||||||
public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, MessageBodyReader<Object> {
|
public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, MessageBodyReader<Object> {
|
||||||
|
|
||||||
|
public static final String DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
private static final String UTF_8 = "UTF-8";
|
private static final String UTF_8 = "UTF-8";
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ public class GsonMessageBodyHandler implements MessageBodyWriter<Object>, Messag
|
|||||||
private Gson getGson() {
|
private Gson getGson() {
|
||||||
if (gson == null) {
|
if (gson == null) {
|
||||||
final GsonBuilder gsonBuilder = new GsonBuilder();
|
final GsonBuilder gsonBuilder = new GsonBuilder();
|
||||||
gson = gsonBuilder.setDateFormat("EEE, d MMM yyyy HH:mm:ss Z").create();
|
gson = gsonBuilder.setDateFormat(DATE_FORMAT).create();
|
||||||
}
|
}
|
||||||
return gson;
|
return gson;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user