服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > JAVA > 新手入门 > 基础入门 > 查看文档

php5程序中新增加日期(date)函数的常量

php 5.1.1 起定义有以下常量来提供标准日期表达方法,可以用于日期格式函数(例如 date())。

date_atom(string)

原子钟格式(如:2005-08-15t15:52:01+00:00)

date_cookie(string)

http cookies 格式(如:mon, 15 aug 2005 15:52:01 utc)

date_iso8601(string)

iso-8601(如:2005-08-15t15:52:01+0000)

date_rfc822(string)

rfc 822(如:mon, 15 aug 2005 15:52:01 utc)

date_rfc850(string)

rfc 850(如:monday, 15-aug-05 15:52:01 utc)

date_rfc1036(string)

rfc 1036(如:monday, 15-aug-05 15:52:01 utc)

date_rfc1123(string)

rfc 1123(如:mon, 15 aug 2005 15:52:01 utc)

date_rfc2822(string)

rfc 2822(如:mon, 15 aug 2005 15:52:01 +0000)

date_rss(string)

rss(如:mon, 15 aug 2005 15:52:01 utc)

date_w3c(string)

world wide web consortium(如:2005-08-15t15:52:01+00:00)

比如,要输出一个rss需要的日期格式,就可以用下面的代码简单实现:

echo date(date_rss);

扫描关注微信公众号