PHP Common date phase function [date plus minus, two date difference, date conversion time Cut]
The following code is some of the most commonly used date processing functions, can be two times the date plus and minus, the difference between the two dates, date conversion time cut.
echo Date (' y-m-d ', Strtotime (' +1 d ', strtotime (' 2009-07-08 '))//Date days Add function
echo Date ("y-m-d", ' 1246982400 '); Echo ' <br> '; echo Date ("y-m-d", ' 1279123200 '); Die ();
$d = "2009-07-08 10:19:00"; echo Date ("Y-m-d", Strtotime ("$d +1 Day")); Date days Add function
function Datetotime ($d)//convert date to time heap cut { $year = ((int) substr ("$d", 0,4);
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.