justinmclean opened a new issue, #8204:
URL: https://github.com/apache/gravitino/issues/8204

   ### What would you like to be improved?
   
   Correct JsonDateSerializer so it now formats dates using UTC (also known as 
Zulu or Zebra time) instead of the system’s default timezone.
   
   Here is a unit test showing the issue:
   ```
     @Test
     @SuppressWarnings("JavaUtilDate")
     public void testSerializeUsesUtcTimezone() throws Exception {
       TimeZone original = TimeZone.getDefault();
       try {
         TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
         JsonDateSerializer serializer = new JsonDateSerializer();
         ObjectMapper mapper = new ObjectMapper();
         StringWriter writer = new StringWriter();
         JsonGenerator generator = 
mapper.getJsonFactory().createJsonGenerator(writer);
         Date date = new Date(0L);
         serializer.serialize(date, generator, mapper.getSerializerProvider());
         generator.flush();
         assertEquals("\"1970-01-01T00:00:00Z\"", writer.toString());
       } finally {
         TimeZone.setDefault(original);
       }
   ```
   
   ### How should we improve?
   
   see above


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to