PHP time operations

Source: Internet
Author: User
: This article mainly introduces PHP time operations. if you are interested in the PHP Tutorial, you can refer to it. Date Operations are frequently used. The following is a simple function. It is mainly necessary to distinguish the commonly used time structures in PHP. Please refer to the following code, which involves most of the time to operate functions. it is helpful.
 = $end_str){echo 'brk'."\n";break;}//echo date_frormat($ans,'Y-m-d H:i:s')."\n";}?>

Output all the time in two time periods, with an interval of 1 day. Date_add () can be changed to date_sub ().

There are also time operations in mysql. you can refer to the following SQL statement

select '2014-10-10',date_add('2015-1-1', interval 1 day);

The output values are 2014-10-10 and 2015-01-02. In Mysql, time occupies two places. for example, the actual situation in Mysql-1-1 is. pay attention to these details (pay more attention when comparing the time ). The program should be flexibly used as needed.

The above describes the PHP time operations, including the content, and hope to be helpful to friends who are interested in the PHP Tutorial.

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.