why do you need to do this with ereg. That would be the complete wrong way of doing it. It could be done, but it would not be pretty.
The best method to use would be a
list($date,$time) = split(" ",$datetime);
otherwise, if you must use ereg, then I think this should work
$date = ereg("[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]",$datetime);