超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<dba_synccheckdate>
Last updated: Fri, 22 Jun 2007

XVIII. 时间日期函数库

简介

可以用这些函数得到 PHP 所运行的服务器的日期和时间。可以用这些函数将日期和时间以很多不同方式格式化输出。

注: 请留意这些函数依赖于服务器的地区设置。确认在使用这些函数时考虑到了夏令时的设置和闰年。

需求

无需外部库文件就可以加入本扩展模块的支持。

安装

这些函数作为 PHP 核心的一部分,无需被安装即可使用。

运行时配置

该扩展模块未定义任何设置指令。

资源类型

该扩展模块未定义任何资源类型。

预定义常量

该扩展模块未定义任何常量。

目录
checkdate -- 验证一个格里高里日期
date_sunrise --  Returns time of sunrise for a given day and location
date_sunset --  Returns time of sunset for a given day and location
date -- 格式化一个本地时间/日期
getdate -- 取得日期/时间信息
gettimeofday -- 取得当前时间
gmdate -- 格式化一个 GMT/UTC 日期/时间
gmmktime -- 取得 GMT 日期的 UNIX 时间戳
gmstrftime --  根据区域设置格式化 GMT/UTC 时间/日期
idate --  Format a local time/date as integer
localtime -- 取得本地时间
microtime --  返回当前 UNIX 时间戳和微秒数
mktime -- 取得一个日期的 UNIX 时间戳
strftime --  根据区域设置格式化本地时间/日期
strtotime --  将任何英文文本的日期时间描述解析为 UNIX 时间戳
time -- 返回当前的 UNIX 时间戳



add a note add a note User Contributed Notes
时间日期函数库
25-Apr-2000 09:44
Regarding the postings regarding MySQL timestamps, please be aware that there are several MySQL date and time types, as documented at
http://www.mysql.com/Manual_chapter/manual_Reference.html#Date_and_time_types

So, in reference to the above posts, nic_lee's algorhythm works on the MySQL TIMESTAMP type, while jmat's function works on the MySQL DATETIME type -- they are NOT the same!

<dba_synccheckdate>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22