function FormatShowTime($nTotalSec)
{
//echo "total sec:" . $nTotalSec . '<br>';
$strTime = "";
//day
if ($nTotalSec > 3600 * 24)
{
$nDay = (int)($nTotalSec / (3600 * 24));
//$nDay > 0 ? $nDay : 1;
$strTime = $nDay;
$strTime .= '天';
//echo "nDay:" . $nDay . '<br>';
}
//hour
if ($nTotalSec > 3600)
{
$nHour = ((int)($nTotalSec / 3600)) % 24;
//$nHour > 0 ? $nHour : 1;
$strTime .= $nHour;
$strTime .= '时';
//echo "nHour:" . $nHour . '<br>';
}
//miniute
if ($nTotalSec > 60)
{
//$nMin = ceil($nTotalSec / 60) % 60 ;
$nMin = ((int)($nTotalSec / 60)) % 60;
//$nMin > 0 ? $nMin : 1;
$strTime .= $nMin;
$strTime .= '分';
//echo "nMin:" . $nMin . '<br>';
}
//second
$nSec = $nTotalSec % 60 ;
$strTime .= $nSec;
$strTime .= '秒';
//echo $strTime . '<br>';
return $strTime;
}
function SubTime($last_time, $before_time)
{
$year = 0;
$month = 0;
$day = 0;
$hour = 0;
$min = 0;
$sec = 0;
//get time pram
GetTimeParam($last_time, $year, $month, $day, $hour, $min, $sec);
$nLastTime = mktime($hour, $min, $sec, $month, $day, $year);
GetTimeParam($before_time, $year, $month, $day, $hour, $min, $sec);
$nCurrTime = mktime($hour, $min, $sec, $month, $day, $year);
$nSubTime = ($nCurrTime - $nLastTime);
return $nSubTime;
}
function GetTimeParam($strTime, &$year, &$month, &$day, &$hour, &$min, &$sec)
{
//echo "$strTime=" . $strTime . '<Br>';
//2010-01-26 12:45:04
$arr = explode(" ", $strTime);
//echo '$arr[0] = ' . $arr[0] . '<br>';$arr[0] = 2010-01-26
//echo '$arr[1] = ' . $arr[1] . '<br>';$arr[1] = 16:44:44
//get year...
$arr1 = explode('-', $arr[0]);
$arr2 = explode(':', $arr[1]);
$year = $arr1[0];
$month = $arr1[1];
$day = $arr1[2];
$hour = $arr2[0];
$min = $arr2[1];
诸如 Google Doc 等Web应用,允许通过互联网共享信息进行协同工作,给我们带来了全新的日常办公体验。随着大量的桌面应用被移植到 Web 环境,无论是纯粹的 HTML+CSS+JS 或者 RIA 都将更受追捧。
以下是两款开放源代码的 Web 办公软件:
1. OpenGoo
&nbs ......