2007-02-06T14:24:43+00:00
小写c表示ISO8601日期,日期格式为YYYY-MM-DD,用字母T来间隔日期和时间,时间格式为HH:MM:SS,时区使用格林威治标准时间(GMT)的偏差来表示。
echo date('r');
Tue, 06 Feb 2007 14:25:52 +0000
小写r表示RFC822日期。
实例:
<?php
/*
@author hills
@tencentqq 3303911
@web www.abzz.net
@email hackhgs@qq.com
@blog blog.abzz.net
@mobiletelethone 1345-2626-567
@filecreate 2009-12-25-13:20,copyright hills
*/
$utc=date(”T”);
if ($utc==”UTC”)
$h=date(”h”)+8;
$dateshow=date(”Y-m-d “.$h.”:i:s”);
function rn()
{
if (date(”L”)==1)
{
echo “是”;
}
else
{
echo “否”;
}
}
$weeks=date(”l”);
$year=date(”W”);
$dayyear=date(”z”);
$weeksmemberic=date(”t”);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”x-ua-compatible” content=”IE=EmulateIE7″ />
<meta http-equiv=”content-language” content=”zh-cn” />
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<meta http-equiv=”keywords” content=”date()函数” />
<meta http-equiv=”description” content=”date()函数” />
<meta http-equiv=”author” content=”hills” />
<title>date()函数</title>
<link href=”css/default.css” rel=”stylesheet” media=”all” type=”text/css” />
</head>
<body>
<div>
<div>
<ul>
<li><?php echo “时区:”.$utc;?></li>
<li><?php echo “当前时间(+8):”.$dateshow;?></li>
<li><?php echo (”是否闰年:”); rn();?></li>
<li><?php echo “星期:”.$weeks;?></li>
<li><?php echo “今天是全年中第:”.$year.”周”;?></li>
<li><?php echo “今天是今年的第”.$dayyear.”天”;?></li>
<li><?php echo “本月一共有”.$weeksmemberic.”天”;?></li>
</ul>
</div>
</div>
</body>
</html>







