免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 900 | 回复: 0
打印 上一主题 下一主题

php常用函数(时间日期) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-04 14:42 |只看该作者 |倒序浏览

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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP