Constants for new date functions in PHP5 programs

Source: Internet
Author: User
Tags echo date rfc

PHP 5.1.1 defines the following constants to provide a standard date expression method that can be used in date format functions (for example, Date ()).

Date_atom (String)

atomic clock format (e.g.: 2005-08-15t15:52:01+00:00)

Date_cookie (String)

HTTP Cookies format (such as: Mon, Aug 15:52:01 UTC)

date_iso8601 (String)

ISO-8601 (eg: 2005-08-15t15:52:01+0000)

date_rfc822 (String)

RFC 822 (such as: Mon, Aug 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 (such as: Mon, Aug 15:52:01 UTC)

date_rfc2822 (String)

RFC 2822 (such as: Mon, Aug 2005 15:52:01 +0000)

Date_rss (String)

RSS (such as: Mon, Aug 15:52:01 UTC)

DATE_W3C (String)

World Wide Web Consortium (such as: 2005-08-15t15:52:01+00:00)

For example, to output an RSS-Required date format, you can use the following code to simply implement:

echo Date (DATE_RSS);

Related Article

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.