set start time and end time