For the Zucchini Bars:
Preheat the oven to 350°F (175°C). Grease and flour a 10x15-inch jelly roll pan or line it with parchment paper.
Prepare the zucchini: Wash and trim the ends, then grate using the large holes of a box grater. Measure 2 cups of shredded zucchini. If very watery, blot gently with paper towels.
Mix wet ingredients: In a large bowl, whisk together granulated sugar, brown sugar, vegetable oil, eggs, and vanilla extract until smooth.
Combine dry ingredients: In another bowl, sift or whisk together flour, cinnamon, nutmeg (if using), baking soda, baking powder, and salt.
Add dry to wet: Gradually add the dry ingredients to the wet mixture, stirring until just combined. Avoid overmixing.
Fold in zucchini: Gently fold the shredded zucchini into the batter until evenly distributed.
Bake: Pour the batter into the prepared pan and spread evenly. Bake for 22–28 minutes or until a toothpick inserted in the center comes out clean and the top is lightly golden.
Cool: Remove from oven and let the bars cool completely in the pan before frosting.
For the Cream Cheese Frosting:
Beat cream cheese and butter: In a bowl, beat softened cream cheese and butter until smooth and fluffy.
Add vanilla and sugar: Mix in vanilla extract, then gradually add powdered sugar and a pinch of salt. Beat until creamy and spreadable. Adjust powdered sugar to reach desired sweetness and consistency.
Frost the bars: Spread the frosting evenly over the cooled zucchini bars.
Slice and serve: Cut into squares or rectangles and serve. Store leftovers in an airtight container in the fridge.