The berth-allocation problem (BAP) aims to optimally schedule and assign vessels to berthing areas along a quay. The vessels arrive at the port over a period of time and normally request service and departure within a time window. These time windows are usually determined through contractual agreements between the port operator and the carrier, in terms of time of departure after the vessel’s arrival at the port. Formulations presented in the current literature, reduce the time window to a point in time. In this paper the discrete dynamic BAP (DDBAP) is formulated as a linear MIP problem with the objective to simultaneously minimize the cost from vessels’ late departures (departure past the time window) and maximize the benefits from vessels’ early departures and timely departures (departure before and within the requested time window). Two different models along with numerical examples and a comparison to other BAP models are presented to demonstrate the benefits of the proposed berth scheduling formulation.