TIME

Returns the serial number of a particular time.

getActiveSheet(); // Add some data $testDates = [[3, 15], [13, 15], [15, 15, 15], [3, 15, 30], [15, 15, 15], [5], [9, 15, 0], [9, 15, -1], [13, -14, -15], [0, 0, -1], ]; $testDateCount = count($testDates); $worksheet->fromArray($testDates, null, 'A1', true); for ($row = 1; $row <= $testDateCount; ++$row) { $worksheet->setCellValue('D' . $row, '=TIME(A' . $row . ',B' . $row . ',C' . $row . ')'); $worksheet->setCellValue('E' . $row, '=D' . $row); } $worksheet->getStyle('E1:E' . $testDateCount) ->getNumberFormat() ->setFormatCode('hh:mm:ss'); echo '
'; // Test the formulae ?> '; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
Date Value Formula Excel TimeStamp Formatted TimeStamp
Hour Minute Second
' , $worksheet->getCell('A' . $row)->getFormattedValue() , '' , $worksheet->getCell('B' . $row)->getFormattedValue() , '' , $worksheet->getCell('C' . $row)->getFormattedValue() , '' , $worksheet->getCell('D' . $row)->getValue() , '' , $worksheet->getCell('D' . $row)->getFormattedValue() , '' , $worksheet->getCell('E' . $row)->getFormattedValue() , '