I' would like to calculate difference between current time and time from String (in minutes).
I've got String (from SQlite database) like this:
String time1= "22:50";
I'm getting current date as:
Date currentDate = new Date()
long test = currentData.getTime();
Parsing String to date:
SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
oldDate = dateFormat.parse(time1);
Then difference:
diff = test - oldDate.getTime();
long seconds = diff / 1000;
long minutes = seconds / 60;
But main problem is caused by lack of current data information (I've only time). I would like to have: Current data + time from String and then compare it to current date and time.