I always thought that date() would automatically return the current date - not the stored one. Guess not.
This was useful (from php.net):
<?
$datetime = "20050905105237";
echo mydate("Y-m-d H:i:s", $datetime);
// Produces 2005-09-05 10:52:37
function mydate($format, $publictime)
{
$sec = substr($publictime, 12, 2);
$min = substr($publictime, 10, 2);
$hour = substr($publictime, 8, 2);
$day = substr($publictime, 6, 2);
$month = substr($publictime, 4, 2);
$year = substr($publictime, 0, 4);
return date($format, mktime($hour, $min, $sec, $month, $day, $year));
}
?>
Thanks!