From 631834b4d6df46dffdbfb833759234576fd66db3 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sat, 9 Apr 2011 18:16:08 +0000 Subject: [PATCH] Minor performance improvement to date conversion routines git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@71598 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Shared/Date.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 6b4e2fcb..d0b96838 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -91,14 +91,14 @@ class PHPExcel_Shared_Date // Perform conversion if ($dateValue >= 1) { $utcDays = $dateValue - $myExcelBaseDate; - $returnValue = round($utcDays * 24 * 60 * 60); + $returnValue = round($utcDays * 86400); if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) { $returnValue = (integer) $returnValue; } } else { $hours = round($dateValue * 24); - $mins = round($dateValue * 24 * 60) - round($hours * 60); - $secs = round($dateValue * 24 * 60 * 60) - round($hours * 60 * 60) - round($mins * 60); + $mins = round($dateValue * 1440) - round($hours * 60); + $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60); $returnValue = (integer) gmmktime($hours, $mins, $secs); }