To add a little bit more information that confused me;
I had always thought the same result could be achieved like so;
theDate.ToString("yyyy-MM-dd HH:mm:ss")
However, If your Current Culture doesn't use a colon(:) as the hour separator, and instead uses a full-stop(.) it could return as follow:
2009-06-15 13.45.30
Just wanted to add why the answer provided needs to be as it is;
theDate.ToString("yyyy-MM-dd HH':'mm':'ss")
:-)