title: Retrieving the time between two dates and checking if a month had passed
body: <p>I have 2 dates assigned to a Calendar instance. (now, and then).</p>
  
  <pre><code>Calendar currentDate = new Calendar().getInstance();
  
  Calendar oldDate = Calendar.getInstance();
  oldDate.setTimeInMillis(plugin.joinTimeLog.getLong(p.getName() + ".time"));
  </code></pre>
  
  <p>Basically, what I am aiming to achieve is that an event may only occur once per month (every 30 days). If 30 days has not passed, then tell them how long until a month will have passed.</p>
  
  <p>Eg. "21d 17hrs 54mins until you have access."</p>
  
  <p>Here is my current code which seems to give a completely incorrect number of days and hours (note; I have not setup minutes yet).</p>
  
  <pre><code>Calendar timeLeft = Calendar.getInstance();
  timeLeft.setTimeInMillis(currentDate.getTimeInMillis() - (oldDate.getTimeInMillis() + (60 * 60 * 24 * 30 * 1000)));
  int daysLeft = daysBetween(currentDate, timeLeft);
  int hoursLeft = Math.round(hoursBetween(currentDate, timeLeft));
  </code></pre>
  
  <p>I then use the following code to determine if a month had passed;</p>
  
  <pre><code>if (daysLeft &lt;= 0) {
  </code></pre>
  
  <p>And here are my methods to obtain the daysLeft and hoursLeft;</p>
  
  <pre><code>public int daysBetween(Calendar d1, Calendar d2) {
      return (int)( (d1.getTimeInMillis() - d2.getTimeInMillis()) / (1000 * 60 * 60 * 24));
  }
  
  public int hoursBetween(Calendar d1, Calendar d2) {
      return (int)( (d1.getTimeInMillis() - d2.getTimeInMillis()) / (1000 * 60 * 60));
  }
  </code></pre>