President Trump loves to take potshots on Twitter at media companies that he thinks treat him unfairly.

On Wednesday, Trump attacked one of his favorite targets, the New York Times, tweeting from his @realdonaldtrump account.

"Remember when the failing @nytimes apologized to its subscribers, right after the election, because their coverage was so wrong. Now worse!"

Trump loves to claim that the publisher is "failing," but that idea needs to be fact checked, because shares of New York Times Co (NYT). are up 30% since he was elected president. If that's a failure, what's his definition of success?

The company's stock is also up nearly 9% so far this year. That's better than the overall market and much better than many of its dead tree and ink rivals.

Remember when the failing @nytimes apologized to its subscribers, right after the election, because their coverage was so wrong. Now worse! — Donald J. Trump (@realDonaldTrump) March 29, 2017

If the people of our great country could only see how viciously and inaccurately my administration is covered by certain media! — Donald J. Trump (@realDonaldTrump) March 29, 2017

Gannett's (GCI) stock has plunged nearly 15% this year. McClatchy (MNI) is down almost 30%. And the awfully-named tronc (TRNC) (formerly Tribune Publishing) is up just 1%.

And as many others have already noted, the notion that the paper "apologized" to its readers is a Trump fantasy. The Times did admit that the outcome of the election was "unexpected." But it never, in its letter to readers in November, asked for forgiveness for any editorial lapses.

Now, to be fair to the president, it is true that the Times has fallen on hard times over the past few decades due to the massive shift in how people consume media -- and the advertising changes that have come along with the digital revolution.

Related: NYT editor: Trump tweets 'wildly' boost subscriptions

Shares of the Times are trading at about two-thirds the price they were before the tech bubble burst in 2000.

And the stock is more than 80% below the all-time highs it hit in the early 1980s -- just as Trump was starting to be a player in the New York City real estate scene.

How's this for irony?

An NYT story about Trump from August 1983 described the future president as a "brash Adonis from the outer boroughs bent on placing his imprint on the golden rock."

"Donald John Trump exhibited a flair for self-promotion, grandiose schemes - and, perhaps not surprisingly, for provoking fury along the way," the story continued.

It also described him as having "alternating skills of charming some individuals and riding roughshod over others." Some things apparently haven't changed all that much.

But Trump has gone from being mainly a NY celebrity to arguably the most powerful person on the planet. The Times obviously has acknowledged that.

And if Trump was being truthful, he should note that the Times has also evolved (in a good way) over the past few years.

It is morphing into a leading digital media company. And that's probably why Wall Street is more excited about its future.

Related: Trump tweeting from an iPhone now, but will he give up on Android?

The company's overall ad revenue is still falling. But digital ad sales were up 11% in the fourth quarter.

And the growth in digital subscriptions has been so strong that it helped lift overall circulation revenue in the quarter, despite a decline in the sale of print editions.

Of course, the Times, like many traditional media companies, is far from healthy. There have been layoffs, staff buyouts and budget cuts over the past few years.

But the digital growth is impressive. Plus, the paper is now backed by Mexican billionaire Carlos Slim Helu, whose family owns a more than 17% stake in the company. At last check, Slim is a lot wealthier than Trump -- and a powerful ally for the NYT to have.

Both are billionaires. But Slim is worth $57 billion according to the latest Bloomberg rankings. That makes him the sixth-richest person on the planet. Bloomberg estimates Trump's net worth at $3 billion.