You could also use [man]mktime/man, e.g.
$datetimestr = '20060126130910';
$datetime = mktime(
substr($datetimestr, 8, 2), //hour
substr($datetimestr, 10, 2), //minute
substr($datetimestr, 12, 2), //second
substr($datetimestr, 4, 2), //month
substr($datetimestr, 6, 2), //day
substr($datetimestr, 0, 4) //year
);
echo strftime('%Y-%m-%d %H:%M:%S', $datetime);