What is the difference between epidemic and pandemic?

Epidemic: An outbreak of disease that attacks many peoples at about the same time and may spread through one or several communities. 

Pandemic: When an epidemic spreads throughout the world.