<?php
$x = 0.774166666666667;
function format_excel_time($time)
{
$time = $time * 1440;
$m = add_zero(intval($time/60));
$s = add_zero($time%60);
return $m . ':' . $s;
}
function add_zero($s)
{
return strlen($s) <= 1 ? '0' . $s : $s;
}
echo $x . ' = ' . format_excel_time($x) . "\n";
?>
转载请注明:阿尤博客 » EXCEL小数时间转为正常时间函数