PHP getdate() 函数

PHP Date/Time PHP Date/Time 参考手册

实例

返回当前本地的日期/时间的日期/时间信息:

<?php
print_r(getdate());
?>

运行实例 »

定义和用法

getdate() 函数返回某个时间戳或者当前本地的日期/时间的日期/时间信息。

语法

getdate(timestamp);

参数描述
timestamp可选。规定整数的 Unix 时间戳。默认为当前本地时间(time())。

技术细节

返回值:返回带有与时间戳相关的信息的关联数组:
  • [seconds] - 秒
  • [minutes] - 分
  • [hours] - 小时
  • [mday] - 一个月中的第几天
  • [wday] - 一周中的某天
  • [mon] - 月
  • [year] - 年
  • [yday] - 一年中的某天
  • [weekday] - 星期几的名称
  • [month] - 月份的名称
  • [0] - 自 Unix 纪元以来经过的秒数
PHP 版本:4+


PHP Date/Time PHP Date/Time 参考手册

0 个评论

要回复文章请先登录注册