2017 would be optimal, imo. Release both a Wii U successor (and for the love of god drop the 'Wii' brand) and a 3DS successor at that time, and make sure they can actually keep up with the competition, not drop behind once the PS5 or Xbox One 2 come out, even if it means selling ahead-of-its-time hardware at a loss (and make sure it's x64, or at the very least x86 to make developing games cross-platform easy and thus getting more ports). It's the only way Nintendo can stay in the home console business and win back third-party developers.
You're Gonna Carry That Weight.
Xbox One - PS4 - Wii U - PC