The first flight out of SAN is 6:30am, and landing curfew is 11:30pm. You will findflights that say they depart SAN earlier, but there's a long queue of planes first thing in the morning. The earliest I've been in the terminal is 5am and it's bustling.
You can stay in DEN around the clock. I'm not sure when the latest flights out are, but flights leave as early as 6am.