I cannot print more than 25 dates, it somehow goes crazy and continues from another date, why?
<p>I have a datepicker, and I pick up two dates, like 2012-04-08 and 2012-05-11. Because I have a database and need store dates as strings I convert them to 20120408 and 20120511 (strings so far). My code contains the next steps. I call my function with these strings:</p>

<pre><code>public void durva(String datefrom, String dateto) throws ParseException {

    datefrom = GlobalVars.getDateStringFrom();
    dateto = GlobalVars.getDateStringTo();

    Log.i("DateFrom", datefrom);
    Log.i("Dateto", dateto);

    SimpleDateFormat formatter2 = new SimpleDateFormat("yyyyMMdd"); //-de most yyMMdd
    formatter2.setLenient(false);

    Date dates1;
    Date dates2;
    long mili1;
    long mili2;

    long diff;

    String dates="";
        String convertedDates = "";

    dates1 = formatter2.parse(datefrom);
           mili1 = dates1.getTime(); 
           Log.i("date1",  String.valueOf(mili1));
   dates2 = formatter2.parse(dateto);
           mili2 = dates2.getTime(); 
           Log.i("date2",  String.valueOf(mili2));

   diff = 1+((mili2-mili1)/86400000);

   Log.i("diff",  String.valueOf(diff));

   long [] millis = new long[(int) diff];


   for (int i=0;i&lt;diff;i++)
    {
        millis[i] = mili1+(86400000*i);
         Log.i("millii",  String.valueOf(millis[i]));
    dates = dates + String.valueOf(millis[i]) + " ";   


    SimpleDateFormat formatterX = new SimpleDateFormat("yyyyMMdd"); 
    String dateString = formatterX.format(new Date(millis[i]));

          convertedDates = convertedDates + dateString + " ";
    }
      Log.i("DATES",  convertedDates);
      } 
</code></pre>

<p>I use the a created GlobalVars when I pick a date and covert them to this string format I mentioned above. Then I convert them to millisecs. Then I convert them back to my format but it is not important, since the millisecs are already messed up. With   </p>

<pre><code>for (int i=0;i&lt;diff;i++)
        {
            millis[i] = mili1+(86400000*i);
             Log.i("millii",  String.valueOf(millis[i]));
</code></pre>

<p>I always increase the millisecs, but what happens after the 25th value? It travels back in time and continues from another value! In this example I get: 20120408 20120409 .. 20120502 20120314..20120322 .  I add 86400000 (millisecs per day) for jumping a whole day.
What's happening here?
Thank you in advance!</p>
