The answer varies from patient to patient, and whether you have surgery on the right leg or the left leg.  As a general rule, you cannot drive if you are on narcotics or unsafe on the road.  Patients on average are able to return to driving between 2 and 6 weeks after surgery.  I usually advise my patients that if they feel like they wouldn’t be able to stop in the event of an emergency or if a pedestrian suddenly decided to cross the road in front of the car, they should not drive.  Practice on a parking lot before driving on the road.