For Californians, the countdown has begun to 2018 when the “stroke of midnight” will also become the “toke of midnight” for those wanting to legally smoke a joint to ring in the new year.

On New Year’s Day, the nation’s most populous state will become the eighth (along with Washington, D.C.) to have legalized recreational marijuana. Legal marijuana is projected to be a $7 billion industry for California.

But before you get too carried away, know exactly where you can — and cannot — legally inhale. Smoking marijuana is prohibited in restaurants, bars and public areas. It might not even be legal in your rented condo, house or apartment — unless your landlord approves.

Although the desert has a reputation as a pot-friendly haven in Southern California, not every community has hung out a welcome sign for dispensaries and other marijuana-related businesses.

So, if you choose to take advantage of the new law, especially in the desert, know where you can toke. Just because Proposition 64 makes marijuana legal in the state, doesn’t mean it is legal everywhere. The voter initiative, which passed with 57 percent voter approval and became law on Nov. 9, 2016, makes pot legal at the state level, but cities can decide independently which, if any cannabis-related activities they want to allow.

A survey of Coachella Valley communities shows that Cathedral City, Desert Hot Springs, Palm Desert and Palm Springs permit both adult-use and medical marijuana dispensaries. Adult use means anyone 21 and older.

Indian Wells, Indio, La Quinta and Rancho Mirage have given cannabis business the cold shoulder – for now  when it comes to operating a dispensary or growing pot as a business.

The Coachella Valley’s reputation for being “pot-friendly” likely stems from Desert Hot Springs being the first city in Southern California to legalize large-scale medical marijuana cultivation. It was born out of financial need.

In 2014, after the city declared a fiscal emergency, the City council voted to legalize dispensaries and cultivation. The five-member City Council established certain zones where growing was permitted, including on a stretch of barren desert.

Since the ordinance passed, officials have approved applications for at least 11 businesses with plans for more than 1.7 million square feet of cultivation operations.

Today, there are more than two dozen licensed medical cannabis dispensaries doing business in the Coachella Valley. Many are mulling the option of adding adult-use recreational marijuana after Jan. 1.