It's 2035 and it is not a strict ban, rather it's a fine of 95 euro/1g of CO2 emmissions above 0g/km, so it's 9500 euro for a car emitting 100g/km, for example. That is to be paid by the manufacturer for every such car sold. So if Porsche decides it can sell their gas hogs emitting 200g/km and the customers will swallow the 20k fine, in theory they could.
The limits and fines are getting progressively tighter since 2020, with steps in 2025, 2030 and the final step in 2035.