How long does it take to rebuild credit after a bankruptcy?

How long does it take to rebuild credit after a bankruptcy?