How can I add/subtract with time in Java? For example, I'm writing a program that when you input your bedtime, it then adds 90 minutes (the length of 1 sleep cycle) to tell you the ideal wake up time.
Scanner input;
input = new Scanner (System.in);
int wakeup0;
int wakeup1;
int wakeup2;
int wakeup3;
int wakeup4;
int wakeup5;
System.out.println("When will you be going to bed?");
int gotobed = Integer.parseInt(input.nextLine());
wakeup0 = gotobed + 90;
wakeup1 = wakeup0 + 90;
wakeup2 = wakeup1 + 90;
wakeup3 = wakeup2 + 90;
wakeup4 = wakeup3 + 90;
wakeup5 = wakeup4 + 90;
System.out.println("You should set your alarm for: "+wakeup0+" "+wakeup1+" "+wakeup2+" "+wakeup3+" "+wakeup4+" or "+wakeup5);
How do I make it so that when I add 90 to 915 it gives me 1045 rather than 1095?