My first answer so don't hurt me much.
I'm not quite sure what you want to do (put back in the database or perform further operations so I only posted one solution)
The number you posted 39787.0 is a unix timestamp. You need to use mktime to convert what you want to a number (And you need date to convert it to a readable form). Since mktime uses 1901-01-01 as a starting date as well you have to make a couple of changes.
I was a biz lazy and didn't include all the code for all fields but this should allow you modify to add whatever you want (and possibly clean it up to a single line if you want).
I made it in long form so it's easy to read.
<?
$olddate = 39787.0;
$hour = 0;
$min = 0;
$sec = 0;
$month = 0;
$year = 0;
$day = 12;
$month += date("m",$olddate);
$day += date("d",$olddate);
$year += date("Y",$olddate);
$x = date("Ymd",mktime($hour,$min,$sec,$month,$day,$year));
echo $x;
?>