Home > php教程 > php手册 > PHP 5中新增加的日期(date)函数的常量

PHP 5中新增加的日期(date)函数的常量

WBOY
Release: 2016-06-13 11:01:34
Original
1325 people have browsed it

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需要的日期格式,就可以用下面的代码简单实现:

<p>echo date(DATE_RSS);</p>
Copy after login

【相关文章】


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template