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

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

WBOY
Release: 2016-06-13 09:33:34
Original
889 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需要的日期格式,就可以用下面的代码简单实现:

  echo date(DATE_RSS);

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