Well, here’s two EU (both old and new) answers;
https://www.youtube.com/watch?v=f1A7DO_3I1k
Hidalgo points to a Disney-EU novelization that claims that Dagobah, being a planet very strong in the Force, operates on it’s own time and laws of physics. So essentially Luke spent more time on Dagobah, than the Falcon spent travelling to Bespin.
And the old West End Games books estimated that Luke trained for ca. 6 months.