Serial input values only working for very short seconds I just made a very basic circuit with a LED and a resistor. I also wrote a program that's supposed to take an input for how long to keep the LED on for. It works fine for shorter times like 10 seconds but as soon as I try to input a time like 120 seconds the LED never turns off.
My code's below. What could be wrong?

int light=9;

void setup() {
  Serial.begin(9600); 
  pinMode(light, OUTPUT); 
  }

void loop() {
  Serial.println("How long do you want the light on for (in seconds)?"); 
  while(Serial.available()==0){} 
  int on_time = (Serial.parseInt() * 1000); 
  digitalWrite(light, HIGH); 
  delay(on_time); 
  digitalWrite(light, LOW); 
  Serial.print("The light was just on for "); 
  Serial.print(on_time/1000);
  Serial.print(" seconds. ");
}
If you add Serial.println(on_time); right after int on_time = (Serial.parseInt() * 1000); you will see the problem. Once you enter the number 33 for example, the integer value printed is -32536. The Allowed data type for delay() is unsigned long, so the negative number is causing a problem.

Using Serial.println() judiciously can be very helpful when you are trying to debug a sketch.