PHP Modify the time format code _php tips

Source: Internet
Author: User
To modify the time format:
Date ("Y-m-d", Strtotime ($list [' pubdate ']));
Learn to explain: put time into strtotime after the time stamp with date () conversion format. The following two functions are written

PHP Strtotime () function
The strtotime () function resolves the date-time description of any English text to a Unix timestamp.

Grammar
Strtotime (time,now) parameter description
Time to specify the string to parse.
Now is the time stamp used to calculate the return value. If this argument is omitted, the current time is used.


The PHP date () function formats the timestamp as a more readable date and time.

Grammar
Date (format,timestamp) parameter description
Format required. Specify the format of the timestamp.
Timestamp optional. Specify the time stamp. The default is the current date and time.

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.