San Francisco could have recreational weed for sale the first week of January under legislation signed by San Francisco's mayor.

Mayor Ed Lee on Wednesday approved legislation that sets up a permitting system and dictates where future pot shops can be located.

All marijuana businesses need a local permit in order to apply for a state license that is required to operate in 2018.

San Francisco will not be ready for sales on New Year's Day when recreational weed becomes legal statewide. More than 40 city outlets now authorized to sell medical marijuana could start selling adult-use pot Jan. 6 if they meet local and state requirements.

The Los Angeles City Council also approved its rules for commercial sales Wednesday.