// TODO Time difference between 2 times
public static boolean getTimeDifference(String current, String updatedTime) {
Log.e("Pixel Current Time", "-->" + current);
Log.e("Pixel Updated Time", "-->" + updatedTime);
boolean timeUpdated = false;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date1 = format.parse(current);
Date date2 = format.parse(updatedTime);
long difference = date2.getTime() - date1.getTime();
if (date1.after(date2)) {
timeUpdated = true;
} else if (date1.before(date2)) {
timeUpdated = false;
}
} catch (ParseException e) {
e.printStackTrace();
}
return timeUpdated;
}
public static boolean getTimeDifference(String current, String updatedTime) {
Log.e("Pixel Current Time", "-->" + current);
Log.e("Pixel Updated Time", "-->" + updatedTime);
boolean timeUpdated = false;
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date1 = format.parse(current);
Date date2 = format.parse(updatedTime);
long difference = date2.getTime() - date1.getTime();
if (date1.after(date2)) {
timeUpdated = true;
} else if (date1.before(date2)) {
timeUpdated = false;
}
} catch (ParseException e) {
e.printStackTrace();
}
return timeUpdated;
}