If they are traveling in opposite directions, in relation to each other, they are traveling away from each other at a rate of 30 mph. Therefore, at a rate of 30mph (that they are driving away from each other at) it will take 180mi/30mph=6 hours to be that far apart. They will be 180 miles apart at the same amount of time, so the answer is 6 hours.
Hope this helps!