Trump's off base about what happens if there's no clear election winner. Here's the deal.

President Donald Trump told followers last week that the speaker of the House might succeed him in office if the election result isn't known by December.

"There's a theory that, if you don't have it by the end of the year, crazy Nancy Pelosi would become president," he said.

Pelosi is in the presidential line of succession, but Trump's got the timing wrong and such an outcome is highly unlikely in any event.

Most presidential elections go so smoothly that little attention is paid to how they actually work (with the most recent exception of 2000) — and to the fact that only 538 people vote directly for president and vice president. They're the presidential electors making up what's known as the Electoral College.

The number of electors each state gets is equal to its seats in the U.S. House plus two for its U.S. senators. California has the most, with 55. Seven of the most sparsely populated states and the District of Columbia have three each.

Before the election, each state political party chooses a slate of people to act as presidential electors if its candidate wins. So when voters go to the polls, they're actually choosing between different slates of electors. Some states even print their names on the ballot along with the candidates.

In 48 states and Washington, D.C., the popular vote determines which slate of electors is chosen, winner take all. In Maine and Nebraska, some electors are chosen in individual congressional districts, some by the statewide vote. A total of 33 states require electors to vote for the winner of the popular vote, and the U.S. Supreme Court in July upheld state laws that prohibit what are known as "faithless electors," who refuse to vote for the popular vote winner at the Electoral College.

The electors meet in December to cast their votes, which are tabulated before a joint session of Congress on Jan. 6, the day of actual presidential vote count.

The Constitution gives Congress authority to set the date for the general election, which is the first Tuesday after the first Monday in November — Nov. 3 this year. Congress has also determined that the Electoral College meets the first Monday after the second Wednesday in December. That will be Dec. 14 this year — 41 days after the general election.

Federal law also provides that if a state conclusively chooses its slate of electors up to six days before the Electoral College meets, Congress must consider those votes valid on the counting day in January. This is known as the "safe harbor" deadline. The Supreme Court said Florida's desire to meet it was a key reason the court stopped the vote counting there in 2000, making George W. Bush the winner.

If a state wishes to take advantage of that provision, it has only 35 days after the election to decide who won.

In most recent elections, the results were clear within several hours after the polls closed. But it's bound to be different this time, with estimates that over half of the votes will be cast by mail. In many states, envelopes containing those ballots won't even be opened until the polls close. And before they're counted, they must be checked to verify that they were validly cast.

"If you can't start the process early, then you are making it virtually certain, with the number of ballots states are going to have, that they're not going to have the results for a week or so," said Rick Pildes, an election law expert at New York University law school. "That problem drives me crazy."

State laws provide a period after the election for officially certifying the outcome, through a process known as the vote canvass. It's during that time that recounts can be triggered by very close outcomes, and candidates can file their legal challenges to voting and counting procedures.

But even if that process takes several weeks, said Ned Foley, who directs the election law program at Ohio State University's Moritz College of Law, "that wouldn't constitute a delay, because election results aren't official until a month after the election."

The new Congress is sworn in Jan. 3 and meets in a joint session three days later to count the votes. If a state succeeded in meeting the safe harbor deadline, its votes must be counted. But even if that deadline was missed, Congress can still count a state's electoral votes. If any member of Congress objects to counting any given vote, both the House and Senate vote on what to do.

But what if there's no clear winner in the Electoral College vote?

The Constitution provides the answer: The House chooses the president, with each state, not each member, casting a single vote. The Senate chooses the vice president.

Only one president took office that way under the current Electoral College system — John Quincy Adams in 1825. In 1877, Congress set up a special commission to resolve disputes over ballots in three states, which resulted in a victory for Rutherford B. Hayes. It was that dispute that led to the establishment of the safe harbor provision.

The issue of no clear winner in the popular vote would be one for each individual state in determining its slate of electors.

There could be no clear winner in the Electoral College vote if, as in the Adams election, no candidate got a majority or if the vote is very close and some electoral votes are disputed.

Under the Constitution, the four-year terms for president and vice president end on Jan. 20. If Congress is unable to choose the winners by then, the Presidential Succession Act kicks in. First in line to serve as acting president is the House speaker, now Nancy Pelosi, followed by the president pro tempore of the Senate, who is now Charles Grassley of Iowa, followed by members of the Cabinet.

But they might be reluctant to accept the role, because they would be required to resign from Congress in order to take the position and could serve only until Congress finally decided who the president will be.

So there’s no way Trump's scenario could unfold by the end of December, and Pelosi couldn't become acting president until Jan. 20, an extremely unlikely outcome.