Um, if you're wanting general-purpose SQL, then perhaps you shouldn't be using MySQL timestamps...
But anyway, devinemke's code can be compressed:
list($year, $month, $day, $hour, $minute, $second) =
sscanf($tempDate, "%4d%2d%2d%2d%2d%2d");
(Oops. Fixed. Use sscanf, not sprintf.)
seby: No: date() won't work.