If you get injured from a piece of metal or rusty metal you need to get the tetanus shot within the same day or 24 hour period if possible.
After the injury you should go to the hospital or see your doctor or go to urgent care within a few minutes of getting the injury and getting the tetanus shot done.
If you've already had a tetanus shot within 10 years then there's no need for another tetanus injection until 10 years have passed since your last tetanus injection.
If it has been 10 years or more since your last tetanus shot then you need to get a tetanus injection within the same day or 24 hours of getting the injury.
The sooner you get the tetanus injection after the injury the better since tetanus can be deadly if you're infected with it.
So if you don't remember when you had your last tetanus injection it's better to get another tetanus injection just to be safe.