Add a new date function constant in PHP5 program _ PHP Tutorial

Source: Internet
Author: User
Tags http cookie
Add the constant of the date function in the PHP5 program. The following constants are defined in PHP5.1.1 to provide standard expression methods for date formats (such as date ()). DATE_ATOM (string) atomic clock format (for example,: 15t15: 52: 01 + 0 PHP 5.1.1) the following constants are defined to provide a standard date expression method, it can be used for date format functions (such as date ()).

DATE_ATOM (string)

Atomic clock format (for example, 2005-08-15T15: 52: 01 + 00: 00)

DATE_COOKIE (string)

HTTP cookie format (for example, Mon, 15 Aug 2005 15:52:01 UTC)

DATE_ISO8601 (string)

ISO-8601 (e.g.: 15t15: 52: 01 + 0000)

DATE_RFC822 (string)

RFC 822 (for example, Mon, 15 Aug 2005 15:52:01 UTC)

DATE_RFC850 (string)

RFC 850 (for example, Monday, 15-Aug-05 15:52:01 UTC)

DATE_RFC1036 (string)

RFC 1036 (for example, Monday, 15-Aug-05 15:52:01 UTC)

DATE_RFC1123 (string)

RFC 1123 (for example, Mon, 15 Aug 2005 15:52:01 UTC)

DATE_RFC2822 (string)

RFC 2822 (for example, Mon, 15 Aug 2005 15:52:01 + 0000)

DATE_RSS (string)

RSS (for example, Mon, 15 Aug 2005 15:52:01 UTC)

DATE_W3C (string)

World Wide Web Consortium (for example, 2005-08-15T15: 52: 01 + 00: 00)

For example, to output a date format required by RSS, you can simply implement it using the following code:

Echo date (DATE_RSS );

Http://www.bkjia.com/PHPjc/814353.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/814353.htmlTechArticlePHP 5.1.1 defines the following constants to provide standard date expressions that can be used for date format functions (such as date ()). DATE_ATOM (string) atomic clock format (for example, 2005-08-15T15: 52: 01 + 0...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.