Who and when was the compass invented?

Over 2000 years ago by the Chinese, by magnetizing needles made from iron, and placing them in water