note 39223 deleted from function.date by nlopess
| From: | nlopess@php.net | Date: | Sun, 31 Jul 2005 11:45:51 +0000 |
| Subject: | note 39223 deleted from function.date by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92800@lists.php.net to get a copy of this message | ||
Note Submitter: aceh at bitex dot bg
----
This is a function that converts the integer part of Delphi TDate (days passed from 30/12/1899) to
Unix Timestamp. Hope it can be useful.
<?php
function DelphiDate2UnixTimestamp($delphi_date){
//delphi date is days passed from 30/12/1899
//unix timestamps start from 1/1/1970 = 25569
$UNIX_FIRST_DATE=25569; //1/1/1970 in Delphi
$days=$delphi_date-$UNIX_FIRST_DATE;
if ($days<0){
$days=0;
}
return strtotime("1 January 1970 + $days days");
}
?>