Here's the answer:
“ich war diesen Sommer zwei Monate lang in China”
Watch a real native speaker say it:
Here's how it sounds in a textbook:
You could also say:
- diesen Sommer war ich zwei Monate lang in China
- zwei Monate lang war ich diesen Sommer in China
Fun fact: the hundreds of thousands of people learning German with Memrise get this phrase correct 96.99% of the time!