Earlier types of antibiotics were prescribed in 10-day increments. Most often, the patient would take a pill three times a day for the full 10 days. Then drug companies were able to make an antibiotic that could be taken once a day for just five days.
In cases like spine surgery or joint replacement antibiotics are used preventively. The goal is to reduce or prevent skin and wound infection. The best time to use antibiotics for this purpose is before the first skin incision has been made.
Doctors have found that the overuse of antibiotics has led to antibiotic-resistant bacteria. To avoid drug-induced adverse events, the suggested timeframe for antibiotic use is 24 hours.