My understanding is that it is done by adding up the ages of the patriarchs in the Old Testament.
This was done by Bishop Usher who calculated 6,000 years.