(d) With respect to a month-to-month or a week-to-week tenancy of a dwelling unit, a notice to quit possession based on nonpayment of rent shall, upon delivery, terminate the rental agreement for the month or week in which the notice is delivered, convert the month-to-month or week-to-week tenancy to a tenancy at sufferance and provide proper basis for a summary process action notwithstanding that such notice was delivered in the month or week after the month or week in which the rent is alleged to be unpaid.