We find the optimal investment strategy to minimize the expected time that an individual's wealth stays below zero, the so-called {\it occupation time}. The individual consumes at a constant rate and invests in a Black-Scholes financial market consisting of one riskless and one risky asset, with the risky asset's price process following a geometric Brownian motion. We also consider an extension of this problem by penalizing the occupation time for the degree to which wealth is negative.