Some caveata about dates of travel:
As others have affirmed: A day partially spent in Canada is, indeed, a day the PR was actually, physically in Canada. So it counts.
While one or two minor inaccuracies do not, ordinarily, draw much attention, it warrants remembering that most applicants want to avoid elevated scrutiny (thus delays, possibly all the inconveniences of RQ), not just avoid outright concerns about meeting the presence-requirements. So it is important to minimize even very minor mistakes, at least as much as possible.
Common sources of error:
-- Most common error is using entry stamp into another country as date of exit from Canada --
It is the date of actually exiting Canada that needs to be reported as the date the person left Canada. Many times the arrival date in another country is actually the next day, and for Trans-Pacific flights it can be two days later. Making this error two or three times can add up to an increased risk of elevated scrutiny.
-- Being on the tarmac, or even inside the terminal, does not mean the traveler is IN-Canada yet --
A person is not in Canada until they have been cleared through the PoE. Even if a traveler has been on the ground and at the gate, and then in line in the terminal for more than an hour before midnight, if clearing the PoE screening is past midnight the date of return is that day, the date it is after midnight. This is an error more likely to be noticed since IRCC often checks the applicant's declared dates of return with the CBSA travel history which should show all or nearly all dates of entry into Canada, and of course those will almost always show the date the PoE officer allows entry.
As noted, sure, this is not a serious error. One or two instances, alone, are not likely to draw attention let alone cause a problem. But again, the prospective applicant, whose aim is to sail smoothly through the process, wants to get this information as correct as possible.
This also applies to leaving Canada. If the flight is scheduled to depart at 11:30 p.m., better to report that as the date of exit, even if the flight ends up sitting on the tarmac until well past midnight.
The comfort of a good margin over the minimum:
There are many reasons why a comfortable margin is the far more comfortable, secure way to approach deciding when to make the application.
The critical one, of course, is to avoid a situation in which a mistake or three, or IRCC's perceived doubts about a few days, could put the application in jeopardy. Remember, IRCC needs to determine that the applicant for-sure was in Canada for at least the minimum, NOT a day less, or the application MUST be denied.
But another hugely important one goes back to the desire to avoid elevated scrutiny, and all the possible delays or potentially even the massively inconvenient RQ. A comfortable margin is more likely to allow the processing agents to be comfortable about meeting the minimum requirements. No rocket science necessary to forecast the trajectory of cutting-it-close.
Many times waiting longer to apply can mean taking the oath sooner.