The time function is Hours, minutes, seconds. If you want 10:45 I would change time(10,4,5) to time(10,45,0) and likelwise for 11:30 time (11,30,0)