I took medications for the first two months of 2012. The definite article is required because the expression is a noun phrase and the time period is specific and definitive. Here are more examples: The first two months of 2012 were exceptionally warm.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.