龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

getdate PHP GETDATE - 获取当前日期时间作为一个关联数组

时间:2014-06-10 02:20来源:网络整理 作者:网络 点击:
分享到:
PHP GETDATE - 获取当前日期时间作为一个关联数组 语法格式如下 [代码片段(5行)]

语法格式如下

array getdate ();
array getdate (integer $Time);

                                参数如下:

Arguments

$Time

The number; of; seconds; since; midnight; before; January; 1;, 1970.; (UNIX style.;)

Default

The default; is; the; current; date; and; time; from; the; operating; system.;)

The return; value; is; an; associative; array; containing;:

mon The month; of; the; year; as; a; number; (1..12)

mday The day; of; the; month; (1..31)

year The year; (4 digits;)

hours The hour; of; the; day; (0..23)

minutes The minutes; of; the; hour; (0..59)

seconds The seconds; of; the; minute; (0..59)

month The month; of; the; year; as; a; word; (January..December)

yday The day; of; the; year; (0..365)

wday The day; of; the; week; as; a; number; (0..6)

weekday The day; of; the; week; as; a; word; (Sunday..Saturday)

0 Seconds since; midnight; before; January; 1;, 1970;

下面是一个使用范例:

<?php

$Now = getdate();

foreach ($Now as $Key => $Value) {
  echo "$Key => $Value\n";
}

?>

                                输出结果如下:
Output:
seconds => 59
minutes => 14
hours => 7
mday => 26
wday => 6
mon => 12
year => 2009
yday => 359
weekday => Saturday
month => December
0 => 1261811699
收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!
按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接