PHP Basic parsing of time date Strtotime

Source: Internet
Author: User
Recently using PHP about time processing frequency is relatively high, now tidy up the knowledge points.

Time ()

The time () function returns the Unix timestamp for the current time.

$t =time (); Echo ($t. "
");
the $t object here outputs a number, This number indicates how many seconds have gone from 1970-01-01 to now.

It's not going to work. Use the DATE function to convert the object to the date we need.

Date (Format,,timestamp)

The date function is very flexible and can be used in a variety of ways to meet the various situations you encounter in the development process.

Format: Required, specifies the time stamp output format;

Timestamp: optional, time specified

Date_default_timezone_set (PRC); /* Transfer time to Beijing time, php5 default to Greenwich Mean Time */

Cond...

The above describes the PHP on time date strtotime basic parsing, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • 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.