PHP gets the same day 0 o'clock time stamp instance analysis

Source: Internet
Author: User
Tags echo date
This article mainly introduces PHP to obtain the same day 0 o'clock time stamp instance analysis, the interested friend's reference, hoped to have the help to everybody.

The code is as follows:

<?phpheader ("Content-type:text/html;charset=utf-8");//Set Beijing time as the default timezone date_default_timezone_set (' PRC ');// The current time of the output is Echo date ("Y-m-d h:i:s", Times ()); 2016-08-11 10:30:32//Get time stamp $today = strtotime (Date ("y-m-d"); Echo ' <br> '; echo $today; 1470844800echo ' <br> ';//Verify that the time stamp on the morning of the day is correct echo date ("Y-m-d h:i:s", $today); 2016-08-11 00:00:00echo ' <br> ';//24-point Timestamp $end = $today +60*60*24;//Verify that the 24-point timestamp for the day is correct echo date ("Y-m-d h:i:s", $ End); 2016-08-12 00:00:00echo ' <br> ';//Get a timestamp of 0 points for the specified time at-----Strtotime (' 2014-06-06 '); Echo ' <br> '; echo $time; 1401984000echo ' <br> ';//verify whether the timestamp for the specified time echo date ("Y-m-d h:i:s", $time); 2014-06-06 00:00:00?>
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.