Converting a string into date format : <p>I'm adding an event, the event displays starting hour (hh:mm) and ending hour (hh:mm), there are 2 tiemPickers, one to pick starting time and one for duration.</p>

<p><strong>Problem 1:</strong> </p>

<p>If the user picks the starting time to be at 10:30h and duration of 1:40h, the ending time should be 12:10h instead of 11:70h, how do I do this?</p>

<p><strong>Problem 2:</strong></p>

<p>If the user picks starting time of 23:00h and duration of 02:00h, ending time should be 01:00h instead of 25:00h.</p>

<p><strong>What I have:</strong></p>

<pre><code>// getting the selected time
int endingHourInt = prefs.getInt("mDurationHour", 0) + prefs.getInt("mStartingHour",0);
int endingMinInt = prefs.getInt("mDurationMin", 0) + prefs.getInt("mStartingMin",0);

// displaying the text
endingTime.setText(endingHourInt + ":" + endingMinInt );
</code></pre>
