All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP5中新增加的日期

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/21 22:24:32 Browse times: 413 Comment times: 0

PHP5中新增加的日期(date)函数的常量_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

PHP5中新增加的日期(date)函数的常量_php资料_编程技术-你的首页-uuhomepage.com

php5.1.1以后,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);





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.