You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/04/02 09:11:51 UTC

[GitHub] [iotdb] Alima777 edited a comment on issue #2818: build fails on AArch64, Fedora 33

Alima777 edited a comment on issue #2818:
URL: https://github.com/apache/iotdb/issues/2818#issuecomment-812428891


   I found a very very interesting thing.
   
   We use `Calendar` class of JAVA to calculate the increase of natural month now, but when it comes to February in leap years, one hour will be minused!!!
   
   E.g. 2020-01-31 08:00:00 + 1 month will be 2020-02-29 08:00:00
   
   BUT 2020-01-31 08:00:00 + 2 month will be 2020-03-31 07:00:00, one hour is minused!
   
   I tried to find what happened.
   
   Actually one year is 365 days 5 hours 48 minutes but not 365 days exactly, so we will add one day in February to make up for this error, which is called a leap year. 
   However, though we add one entire day, it's actually 23 hours 12 minutes!
   
   So I guess when Calendar adds one month through a February in leap year, one hour will be minused.
   
   BUT why we didn't find the error before? 
   
   I tried run the test in different timezone, and found in GMT+08:00, this hour will NOT be minused, so we can't find the error. But in GMT:+00:00, this hour will be minused!
   
   It's so weird, right? We will try to avoid this problem in test. Thanks for your problem~~
   
   


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

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