Linux 版 (精华区)
发信人: fgr (乱舞势力), 信区: Linux
标 题: 用getdate函数取得系统的日期与时间
发信站: 紫 丁 香 (Tue Mar 28 21:14:52 2000), 转信
getdate函数返回一个哈希数组,可以通过 "seconds","minutes","hours",
"mday","wday","mon","year","yday","weekday","month"下标进行访问。
以下是一个访问的实例:
<?
$DateEnum=array("seconds","minutes","hours","mday","wday","mon","year","y
day","weekday","month");
$CurrentDate=getdate();
for ($i=0;$i<10;$i++)
{
echo $DateEnum[$i]."=".$CurrentDate[$DateEnum[$i]]."<br>";
}
?>
如时间若为:1999-10-2 18:17:16
则对应结果如下:
seconds=16
minutes=17
hours=18
mday=12
wday=2
mon=10
year=1999
yday=284
weekday=Tuesday
month=October
--
马青泪眼婆娑的看着她们的背影“就你们这种觉悟,怎么指望你们舍身
炸碉堡好让我过上幸福生活?”
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: 202.118.239.43]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.068毫秒