The formula I posted works perfectly for both the start date and the end date. This can be replicated for finding start time and end time range also.