Added condition for time in  method date_to_close