How long does it take to miss a multimillion-dollar lottery jackpot? In this case, seven seconds.

A man in Quebec claims a processing delay cost him his share of a lottery jackpot worth $21.4 million — and he has spent the past six years and a lot of money trying to collect it. On Thursday, the Canadian Supreme Court dismissed his appeal.

It was a nice try that got him nowhere.

On May 23, 2008, Joel Ifergan made a last-minute decision to play the lottery. The deadline for the upcoming draw was 9 p.m., and a convenience store clerk advised him to hurry. At precisely 8:59 p.m. — and 47 seconds — he bought two Super 7 lotto tickets.

The first ticket was printed with the May 23 date. But the second was printed seven seconds after the cut-off time and stamped May 24, which designated the ticket for the next week’s draw. The clerk asked him whether he still wanted to buy the two tickets, and he said yes, according to the Toronto Sun.

When the lottery numbers were picked, Ifergan got excited — then frustrated. The second ticket had the winning numbers.

“It felt great for about 10 seconds, then I realized the date and now I feel very, very frustrated by the system,” he told CTV News.

He said he met with an attorney for Loto-Quebec, the government agency that runs lotteries in Quebec, and two technicians. “They told us there was a 10- to 12-second delay in transmission time,” he told the news agency. So he took them to court, claiming he bought the tickets in time but Loto-Quebec’s processing delay cost him a fortune. Another person had the winning numbers for that week’s jackpot, so Ifergan said he felt entitled to half the prize — more than $10 million.

“Loto-Quebec during the trial never argued the fact that my request for the two tickets was in their system at 8:59.47,” he told CTV News in Montreal. “The deadline that they advertise was for 9 p.m. — which I did.”

But he didn’t, the courts said.

The Montreal superior court judge who rejected Ifergan’s lawsuit said his decision to keep both tickets when he saw the dates counted as acceptance and the lottery agency had performed its duties fine, according to news reports.

“I’m really disappointed in the decision, and it’s not because it’s about the money,” he told CTV News.

That’s probably for the best. Ifergan said it cost him at least $80,000 to pursue the case.

“My crusade is up, I’ve done all I can, I spent enough money going to the Supreme Court,” he told the Canadian Press.

“Loto-Quebec is pleased with today’s Supreme Court decision which puts an end to a nearly 7-year old case,” Jean-Pierre Roy, Loto-Québec’s media relations director, told USA Today in a statement.

Despite his loss, Ifergan has not lost faith. He said he still plays the game.

“It’s a voluntary tax,” he said. “If we don’t play it, they’ll find another way.”