A method for operating an engine based on cabin temperature includes determining a quantity of fuel in a fuel tank, determining a minimum amount of fuel to remain in the fuel tank, receiving a predetermined cabin temperature value, calculating an engine idle time in response to the minimum amount of fuel and the predetermined cabin temperature value, and controlling engine starting and stopping in response to the engine idle time and the predetermined cabin temperature value.