php时间显示例
第一种:简单(供学习用)
<?PHP
$today=date("Y-m-d G:i:s");
echo "<center>$today</center>";
?>
第二种:
/*
Format Time
*/
Function formatTime($time,$type="1"){
switch($type){
case 1;#2002-06-0418:58 Tuesday
return date("Y.m.d H:i",$time)."<font color=blue>".date(" l",$time)."</font>";
case 2;#June 2002
return date("M Y",$time);
case 3;#2002-06-04 18:58
return date("Y.m.d H:i",$time);
case 4;#06-04 AM
return date("m-d A",$time);
case 5;#06-04 18:58
return date("m.d H:i",$time);
}
}