I am having troubles converting Delphi Tdatetime integer into normal date and time values.
I have a SQLExpress database with date and time fields that are integers. My STARTDATE has the integer 40924 wich should be 16-01-2012 and my STARTTIME has the integer 55200 wich should be 15:35:00
Now I have the following script in php:
$delphi = $row['STARTDATE'];
$unix = 25569;
$datum = $delphi-$unix;
if ($datum<0){
$datum=0;
}
$unixtime = strtotime("1 january 1970 + $datum days");
echo date('d-m-Y', ($unixtime));
It converts the Delphi time to unix. And this works for the date (STARTDATE) but it doesn’t work for the time (STARTTIME).
Now is there anyway to do this better?
The main question is: How can I convert a Delphi DateTime integer into normal date time view in PHP?