Preheat your oven to 350°F (175°C). Grease and flour two 9-inch round cake pans (or a 9x13-inch pan).
In a large bowl, whisk together flour, sugars, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, whisk together oil, eggs, and vanilla. Pour into the dry ingredients and mix until combined.
Fold in grated carrots, crushed pineapple, and nuts (if using).
Divide the batter evenly between the prepared pans and bake for 30-35 minutes, or until a toothpick inserted in the center comes out clean.
Let the cakes cool in the pans for 10 minutes, then transfer to a wire rack to cool completely.