The fact that this first occured in the morning after the vehicle had been standing, and the fact that teh time and date have both reset indicates that your battery needs changing.
The reason your anti-pollution fault came on and the vehicle lost all power is that when the battery voltage dips while starting the car (with a buggered battery) it causes the voltages on all of the ECU's to drop.
This in turn causes false alarms and puts the vehicle into limp home mode.
You'll need to get a new battery, then try leaving the battery positive lead disconnected for a few hours and see if that clears the faults stored in the ECU's, if not then you'll have to have them reset at a dealer or someone with a computer diagnostic equipment.
Once you've sorted out the battery just take a look in the owners manual on how to set the time and date etc if you don't already know how to do that.
Chances are that if your car has automatic headlights then you'll need to re-activate that function again - switch your ignition switch to the first click, then press and hold the button on the very tip of the headlight/indicator stalk until it pings and the center display says Automatic Lighting Activated.
Sean
October 2009