- 论坛徽章:
- 0
|
1.microtime() -- 返回当前 Unix 时间戳和微秒数.(获取比较精细的时间)
返回:mixed类型(混合类型)
ex:
$time = microtime();//获取当前时间的unix微妙数和unix时间戳.
list($usec,$sec) = explode(" ",$time);//获取微妙和unix时间戳.
2.time() --返回unix时间戳.
返回值:返回int类型.
3mktime -- 取得一个日期的 Unix 时间戳
返回值:返回int类型.
ex:
int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )
3.getdate() -- getdate -- 取得日期/时间信息
返回值:数组
ex:获得详细时间信息
4.date() -- 格式化一个本地时间/日期
ex:
date("Y-m-d H:i");//输出当前时间.
注:其他详细参数见php手册.
5.strtotime -- 将任何英文文本的日期时间描述解析为 Unix 时间戳
ex:
strtotime("-1 day");
6.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/43167/showart_374057.html |
|