Merge 9544a64037763f12a80ae80ec907feffe91a03a7 into bb20d2e6bb23307b39e245cebf0c54fe0947aff5

This commit is contained in:
Bartosz Wójcik 2016-05-19 18:54:36 +00:00
commit a2319cbf1d

View File

@ -189,7 +189,17 @@ class CellValueFormatter
// The value 1.0 represents 1900-01-01. Numbers below 1.0 are not valid Excel dates.
if ($nodeValue < 1.0) {
return null;
// treat this value as time-only cell
$time = round($nodeValue * 86400);
$hours = round($time / 3600);
$minutes = round($time / 60) - ($hours * 60);
$seconds = round($time) - ($hours * 3600) - ($minutes * 60);
// the date part is not important here
$dateObj = date_create('1-Jan-2000');
$dateObj->setTime($hours,$minutes,$seconds);
return $dateObj;
}
// Do not use any unix timestamps for calculation to prevent