Fotiman - 11:57 am on Jul 2, 2012 (gmt 0)
Can you post an example of output?
I suspect the problem is with the parseInt. You should always specify the radix value on parseInt, otherwise values that begin with "0" (like "09") will be treated as octal (base 8) instead of decimal (base 10). parseInt will give you 0 in this case (thus satisfying your hour1 < 6 condition).
Change your parseInt lines to:
hour1 = parseInt(expr.exec(output), 10);
hour2 = parseInt(expr.exec(output), 10);
Lesson: ALWAYS include the radix value on parseInt calls.