How long was andy on his boat trip?

Andy returns from his three-month boat odyssey a day earlier much to everyone's annoyance, taking credit for all the successes while he was away, accidentally flying a big bill, and meeting with David Wallace to make it look like he was there the whole time. Maybe someone here can clarify that. My impression has always been that Andy's 3-month boat trip was the time Ed Helms spent filming the hangover. If that's the case, then did the show-runners decide to tank Andy's character to punish Ed for his absence? Whatever the case, Erin's boat trip and negligence was completely out of character and the most disappointing part of the series for me.