note 30682 deleted from function.date by sniper
| From: | sniper@php.net | Date: | Sat, 11 Oct 2003 16:53:22 +0000 |
| Subject: | note 30682 deleted from function.date by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58285@lists.php.net to get a copy of this message | ||
Note Submitter: andreas.schmeiler@rtlnewmedia.de
----
here's an update to the previous function:
the right-comma-part of the win-timestamp
must have 10 digits. It seem in some cases,
that "0"s at the end are cut off (e.G. when
generating such a time stamp by using ASP).
Please modify the function as follows:
function wT2uT($win_timestamp) {
$WIN_DATE_CONST=2209165200;
$WIN_TIME_CONST=115740.74074074;
list($win_date, $win_time)=explode(",",$win_timestamp);
$win_time=substr($win_time."0000000000",0,10);
$ux_date = $win_date*24*60*60;
$ux_date-= $WIN_DATE_CONST;
$ux_time = round($win_time/$WIN_TIME_CONST);
return($ux_date+$ux_time);
}