1、date()格式化一个本地时间与日期,常用格式为"Y-m-d H:i:s"
2、mktime() 取得一个日期的unix时间戳(在php5.3中已被淘汰)
3、time()返回当前的unix 时间戳
4、microtime()返回当前unix时间戳和微秒数
5、localtime() 取得本地时间
6、date_default_timezone_get() 取得一个脚步中所以日期与时间函数所使用的默认时区
7、date_default_timezone_set() 设定用于一个脚本中所以日期与时间函数的默认时区中国"PRC"
8、date_sunrise 返回给定的日期与地点的日出时间
9、date_sunset 返回给定日期与地点的日落时间
10、getdate 取得日期/时间信息,返回一个数组
其中“seconds”秒
"minutes" 分
"hours" 时
"mday" 月份中的第几天
"wday"星期中的第几天
"mon"月
"year" 4位数表示完整的年份
"yday"一年中的第几天
"weekday"星期几
"month"月份的完整
11、strtotime(time,now)函数将任何英文文本的日期时间描述解析为 Unix 时间戳。
<?php echo(strtotime("now")); echo(strtotime("3 October 2005")); echo(strtotime("+5 hours")); echo(strtotime("+1 week")); echo(strtotime("+1 week 3 days 7 hours 5 seconds")); echo(strtotime("next Monday")); echo(strtotime("last Sunday")); ?>