It's not that the formula is wrong; it's only that it doesn't elaborate as to how the game handles log-ins. If anything, that would probably be a separate article.
In reality, you're always logged out. You can log into the game (as an action) but there is no such thing as being logged in (as a state of being). The log-in is a single moment in time. Try getting your head around that one.
https://giant.gfycat.com/...carceAfricanporcupine.gif
I'll provide you a concrete example to illustrate this apparent paradox more simply. Consider other servers where turns don't come so fast. For example, it could be 5:55pm and your Primary country is currently open in another tab, but the game portal will still say "Last played: 0.4h ago." I'm sure you've noticed this.
You didn't log out, but all the game knows is you had a log-in during that turn. If the clock ticks to 6:00pm, it will say your last play is 0.5h ago, even if the window is still open. That's because you're not logged in, as there is no such thing! But the moment you refresh the window, open a new page, or process an action, the portal will say your last play is 0.0h ago. You just logged in and gained a turn after log off!