title: Wrong count of difference days between 2 dates with joda time?
body: <p>good morning together,</p>
  
  <p>i developing an android app and i get crazy!
  since a few days, i try to get the difference days between 2 dates.</p>
  
  <p>i realize it with joda time - this seems to work.</p>
  
  <pre><code>DatePicker datepicker = (DatePicker) findViewById(R.id.Picker);
  
                  Calendar cal = Calendar.getInstance();
                  cal.set(Calendar.YEAR, datepicker.getYear());
                  cal.set(Calendar.MONTH, datepicker.getMonth());
                  cal.set(Calendar.DATE, datepicker.getDayOfMonth());
                  cal.set(Calendar.HOUR_OF_DAY, 0);
                  cal.set(Calendar.MINUTE, 0);
                  cal.set(Calendar.SECOND, 0);
                  long sqlDate = cal.getTimeInMillis();
  
  
  
                  Calendar calToday = Calendar.getInstance();
                  calToday.set(Calendar.YEAR, calToday.get(Calendar.YEAR));
                  calToday.set(Calendar.MONTH, calToday.get(Calendar.MONTH));
                  calToday.set(Calendar.DATE, calToday.get(Calendar.DATE));
                  calToday.set(Calendar.HOUR_OF_DAY, 0);
                  calToday.set(Calendar.MINUTE, 0);
                  calToday.set(Calendar.SECOND, 0);
  
  
  
                  Date date1 = new Date(
                          datePicker.getYear()-1900,
                          datePicker.getMonth(),
                          datePicker.getDayOfMonth()
                  );
  
  
  
                  Date today = new Date(
                          calToday.get(Calendar.YEAR)-1900,
                          calToday.get(Calendar.MONTH),
                          calToday.get(Calendar.DAY_OF_MONTH)
                  );
  
  
  
                  int days = Days.daysBetween(new DateTime(today), new DateTime(date1)).getDays();
  </code></pre>
  
  <p>i save the long sqlDate in my database.
  this is the date of date picker in milliseconds.</p>
  
  <p>Now i would like to request this date with an query and calculate the difference days between the date in milliseconds and the date now.</p>
  
  <p>i try this:</p>
  
  <pre><code>Calendar calToday = Calendar.getInstance();
                  calToday.set(Calendar.YEAR, calToday.get(Calendar.YEAR));
                  calToday.set(Calendar.MONTH, calToday.get(Calendar.MONTH));
                  calToday.set(Calendar.DATE, calToday.get(Calendar.DATE));
                  calToday.set(Calendar.HOUR_OF_DAY, 0);
                  calToday.set(Calendar.MINUTE, 0);
                  calToday.set(Calendar.SECOND, 0);
                  long now = calToday.getTimeInMillis();
                  long DiffDays = (sqlDate - now) / (24 * 60 * 60 * 1000);
  
  
                  Log.e("--&gt;", ""+sqlDate );
                  Log.e("--&gt;", ""+now);
                  Log.e("--&gt;", ""+(sqlDate - now));
                  Log.e("--&gt;", ""+DiffDays);
                  Log.e("--&gt;", "====================");
  </code></pre>
  
  <p>Log Result:</p>
  
  <pre><code>12-02 07:19:09.931 26600-26600/? E/--&gt;: 1451606400515
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 1449014400938
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 2591999577
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 29
  12-02 07:19:09.931 26600-26600/? E/--&gt;: ====================
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 1449187200127
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 1449014400942
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 172799185
  12-02 07:19:09.931 26600-26600/? E/--&gt;: 1
  12-02 07:19:09.931 26600-26600/? E/--&gt;: ====================
  </code></pre>
  
  <p>But this is wrong.
  For Example:</p>
  
  <p>This is the Result of SqlDate - now = 2591999577 (milliseconds)</p>
  
  <p>2591999577 / (24 * 60 * 60 * 1000) = 29,9999 ( 30 days )
  NOT 29 Days</p>
  
  <p>and why get i a decimal result - i calculate every time form 00:00:00 to 00:00:00</p>
  
  <p>i hope you can help me :'(</p>