My android application needs to display time which has to be incremented according to a logical check
my condition example is below
d = (String) DateFormat.format("yyyy-MM-dd,hh:mm:ss", new java.util.Date());
if(condition)
{
//i want to increment the time for about an hour and display
}
else
{
// increment the date to 1 and display
}
am not concerned about the condition but on the code for incrementation of time and date
now how to code in order to increment accordingly to the above mentioned time format
Umm.
Use
Calendarinstead.If you look at the documentation, you should be able to figure out how to do what you want.
If you can’t figure it out from the docs (after putting forth honest effort), then I’ll be happy to elaborate on the process.