How to calculate elapsed time and date in android
<p>I want my app to show the time elapsed from the point an entry was stored in the database to the point it is fetched from the database.</p>

<p>I am currently doing something like this which gives me time elapsed in seconds:</p>

<pre><code>                SimpleDateFormat sdf = new SimpleDateFormat("hh:mm:ss aa");


                Date systemDate = Calendar.getInstance().getTime();
                String myDate = sdf.format(systemDate);

                Date Date1 = sdf.parse(myDate);

                Date Date2 = sdf.parse(savedDate);
                int dateDiff = getTimeRemaining();

                long millse = Date1.getTime() - Date2.getTime();
                long mills = Math.abs(millse);                                                    
                long Mins = mills/(1000*60);

                String diff = +dateDiff+ "days " + Mins+ " mins";
                cal[1] = "" +Mins;
                t3.setText(diff);
</code></pre>

<p>But I also want it to include the no of days since the data was stored. As of now, it resets when the day is over. I want it to give me the total minutes after N days. How should I do it? Thanks in advance.</p>