Github user Jaskey commented on the issue:

    https://github.com/apache/incubator-rocketmq/pull/69
  
    From java doc, 0 of `HOUR` is representing noon or midnight. 
    
    So this problem exists if we call the method after 12:am, the HOUR will 
becomes 12 RATHER than 0, which may result in problems.
    
    Good catch and nice job.
    
    FYI:
    
    you could try with different system clock, which will give you different 
result.
    
            Calendar cal = Calendar.getInstance();
            cal.set(Calendar.DAY_OF_MONTH, 1);
            cal.set(Calendar.HOUR, 0);
            cal.set(Calendar.MINUTE, 0);
            cal.set(Calendar.SECOND, 0);
            cal.set(Calendar.MILLISECOND, 0);
    
            System.out.println(new Date(cal.getTimeInMillis()));
            System.out.println(cal.get(Calendar.AM_PM));



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to