function date2( $time , $format='H:i:s' )
{
  $h = intval($time/3600);
  $minSeconds = $time%3600;
  $i =  intval($minSeconds/60);
  $s = $minSeconds%60;
  if($h<10)$h="0".$h;
  if($i<10)$i="0".$i;
  if($s<10)$s="0".$s;
  $r = $format;
  $r = str_replace("H",$h,$r);
  $r = str_replace("i",$i,$r);
  $r = str_replace("s",$s,$r);
  return $r;
}
Posted on 2007-11-23 13:07  古代  阅读(406)  评论(0编辑  收藏  举报