php 格式化输出日期函数
public function format ($formatTo='standard',$timestamp = NULL) {
if ($timestamp!==NULL) {
$source = $timestamp;
if (!$source) {
return '';
}
} else {
$source = $this->timestamp;
}
switch (strtolower($formatTo))
{
HH:MM:SS”
break ;
case 'cdate':
;
case 'date':
$result = date("Y-m-d", $source); break ;
case 'time':
$result = date("H:i:s", $source); break ;
”
break;
default :
$result = date($formatTo, $source);
}
return $result;