I have my code
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date curDate = new Date();
String finalCurTime=format.format(curDate).substring(11, 19);
Date gpsLastDate = new Date(gpslastKnownLocation.getTime());
String gpsFinalLastTime=format.format(gpsLastDate).substring(11, 19);
How can i compare to below Logic
- Compare
finalCurTime
&gpsFinalLastTime
If(If finalCurTime is more than three hours of gpsFinalLastTime)
{
// Do something-1
}else{
// Do something-2
}