tikafu commented on issue #21891:
URL: https://github.com/apache/pulsar/issues/21891#issuecomment-1892970655

   > > 6. Now assuming that the timezones between broker and client are 
different, will the publish time the admin client get finally be the same as 
its origin?
   > 
   > @tikafu The timezone information isn't preserved, but based on the code, 
the absolute value of the timestamp will be preserved. Are you expecting the 
timezone information to be preserved?
   > 
   > Would you be able to provide and example that reproduces your problem. You 
don't have to show Pulsar code and internals in the reproducer of a bug. :)
   
   @lhotari OK.
   Step1. Set the timezone to Asia/Shanghai and start broker.
   <img width="1358" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/b7252a9b-b885-48fc-bbf5-b23c0a773145";>
   
   Step2.  Produce a message to broker with java client sdk. Notice that the 
timezone of the client is Asia/Shanghai, too.
   <img width="1438" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/ed29fa15-81be-4bfe-b960-532b9fb31692";>
   
   Step3. Consume a message print publish time to console.Notice that the 
timezone of the client is Asia/Shanghai, too.
   <img width="1439" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/3038e72c-ec71-4806-ab85-8090e0c055c9";>
   The publish time is 1705369257394.
   
   Step4. Get the publish time of message with admin sdk. Notice that the 
timezone of the client is Asia/Shanghai, too.
   <img width="1439" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/0248101c-21d0-4752-890b-1256d921f4eb";>
   The publish time is 1705369257394. Everything is ok up to now.
   
   Step5. Set the timezone to GMT and restart broker.
   <img width="1439" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/bf0bf21e-313c-4b12-9269-2384608d0ba8";>
   
   Step6. Consume the same message print publish time to console.Notice that 
the timezone of the client is still Asia/Shanghai.
   <img width="1439" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/4da262e8-cd34-434e-bbd4-46a1e19b1926";>
   The publish time is 1705369257394, which is the same as before.
   
   Step7. Get the publish time of message with admin sdk. Notice that the 
timezone of the client is still Asia/Shanghai.
   <img width="1439" alt="image" 
src="https://github.com/apache/pulsar/assets/10616763/2a3ead63-8748-4820-b2df-1022d35c4c7c";>
   The publish time is 1705340457394, which has already changed.
   
   I am not expecting the timezone information to be preserved, i am expecting 
the absolute timestamp when i use admin sdk to get publish time of the message.


-- 
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