check the start and end time