Minor performance improvement to date conversion routines
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@71598 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
70f773f0ca
commit
631834b4d6
|
@ -91,14 +91,14 @@ class PHPExcel_Shared_Date
|
||||||
// Perform conversion
|
// Perform conversion
|
||||||
if ($dateValue >= 1) {
|
if ($dateValue >= 1) {
|
||||||
$utcDays = $dateValue - $myExcelBaseDate;
|
$utcDays = $dateValue - $myExcelBaseDate;
|
||||||
$returnValue = round($utcDays * 24 * 60 * 60);
|
$returnValue = round($utcDays * 86400);
|
||||||
if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) {
|
if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) {
|
||||||
$returnValue = (integer) $returnValue;
|
$returnValue = (integer) $returnValue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$hours = round($dateValue * 24);
|
$hours = round($dateValue * 24);
|
||||||
$mins = round($dateValue * 24 * 60) - round($hours * 60);
|
$mins = round($dateValue * 1440) - round($hours * 60);
|
||||||
$secs = round($dateValue * 24 * 60 * 60) - round($hours * 60 * 60) - round($mins * 60);
|
$secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60);
|
||||||
$returnValue = (integer) gmmktime($hours, $mins, $secs);
|
$returnValue = (integer) gmmktime($hours, $mins, $secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue