Diamonds are carried to the surface of the earth by magma, or molten rock, which solidifies when it draws closer to the surface. However, the diamonds themselves are much older than the rock that they are found in.
It isn't always possible to find out the age of a diamond by examining it directly. A better method is to look at tiny inclusions, which are crystals made from other minerals that are often found within diamonds. These give out a slight radioactive signal that scientists can measure to find out how old they are.
This means flawless diamonds, that don't have any inclusions, are very difficult to date.
The diamond in the image above contains a violet-red garnet. The garnet gives us a clue to the conditions and rock types that the diamond formed in, as scientists know the temperature and pressure that is needed for garnet to turn into its crystal form.
Other minerals turn into crystals at different temperatures and different pressures.
There is some debate about how accurate the evidence from inclusions is. Many inclusions are very old and so the diamonds they are found in may also have formed a very long time ago. However, some scientists think diamonds could have formed around the inclusions more recently.
Advances in technology mean that we can now create synthetic diamonds and these have increased our understanding of diamonds in the natural world.
By working out the conditions needed to create synthetic diamonds, we have also learned more about how and where real diamonds form, and where else we might hunt for them.