Hey guys i need help to figure out how to calculate the time difference between two certain times (entered by user). But the output has to be split up in hours, minutes and seconds as their own variables.
example:
Startingtime:
Hour: 15 Minute: 50 Second: 00
Finishtime:
Hour: 17 Minute: 14 Second: 23
Result: 1 Hour 24 minutes 23 seconds
Edit: This is what i've got so far, it's the calculation that's my problem
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Starttime:");
System.out.println("---------");
System.out.print("Hour: ");
int HourS = in.nextInt();
System.out.print("Minute: ");
int minuteS = in.nextInt();
System.out.print("Second: ");
int secondS = in.nextInt();
System.out.println("\t");
System.out.println("Finishtime:");
System.out.println("------------");
System.out.print("Hour: ");
int hourF = in.nextInt();
System.out.print("Minute: ");
int minuteF = in.nextInt();
System.out.print("Second: ");
int secondM = in.nextInt();