You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "justinmclean (via GitHub)" <gi...@apache.org> on 2025/08/20 06:27:03 UTC

[I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

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: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-3588557473

   This function was written by Xun and used in authz. I don't have much context about this, maybe @jerqi  knows more about this part than me.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "Eipi-Tong (via GitHub)" <gi...@apache.org>.
Eipi-Tong commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-3236143402

   Hi, I’ve raised a PR for this issue. Looking forward to your review!


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "jgallagher-scottlogic (via GitHub)" <gi...@apache.org>.
jgallagher-scottlogic commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-3206658115

   Am I okay to give this a go please !


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "1278132270 (via GitHub)" <gi...@apache.org>.
1278132270 commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-5507611105

   Hi, I'd like to continue working on this issue.
   I noticed PR #8356 was closed due to inactivity.
   I'll investigate and submit a new PR if appropriate.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-3240697135

   cc @mchades 


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Correct JsonDateSerializer to output UTC times [gravitino]

Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on issue #8204:
URL: https://github.com/apache/gravitino/issues/8204#issuecomment-3208238489

   Yes, you can work on this. Thanks for offering to help. 
   
   Please see our [CONTRIBUTING](https://github.com/apache/gravitino/blob/main/CONTRIBUTING.md) guide. For code contributions, it explains how to compile with Gradle, run unit tests (unit tests should cover all code changes), and format code with Spotless before submitting a PR.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org