Constraining Format for Time Input

Constraining Format for Time Input

Hi, I'm just having a issue with trying to constrain a input box to only let 24 hour time be inputted, eg; 13:30, 09:00, etc.
With the code I have now it output's the alert even if the format is correct. It's probably something really obvious but I have been at it a while now so I'm hoping someone can make me look really stupid 
Heres the code:

  1. In_String = input.Custom_Time; //Gives variable "In_String" the value of Custom_Time inputted by user
  2. Number = "1234567890"; //Defines variable "Number" to hold number values
  3. Retval = false; //Creates value "Retval" to false

  4. if ((input.In_String).length() == (input.Custom_Time).length())
  5. {
  6.     First_In_String = (input.In_String).subString(0,1);//Variable to hold the hours inputted by user
  7.     Sec_In_String = (input.In_String).subString(2);//Variable to hold ":" symbol inputted by user
  8.     Third_In_String = (input.In_String).subString(3,4);//Variable to hold the minutes inputted by user
  9.     
  10.     if (First_In_String == (Number))
  11.     {
  12.         Retval = true;
  13.     }
  14.     else if (Sec_In_String == (":"))
  15.     {
  16.         Retval = true;
  17.     }
  18.     else if (Third_In_String == (Number))
  19.     {
  20.         Retval = true;
  21.     }
  22.     else
  23.     {
  24.         Retval = false;
  25.     }
  26. }
  27. if (Retval == false)
  28. {
  29.     alert "You must enter a time in 24 hour format, eg; 13:30 for 1.30 pm";
  30. }