Home > Backend Development > PHP Tutorial > php比较两个绝对时间的大小_php实例

php比较两个绝对时间的大小_php实例

WBOY
Release: 2016-06-07 17:22:10
Original
885 people have browsed it

复制代码 代码如下:

$zero1=date(“y-m-d h:i:s”);
$zero2=”2010-11-29 21:07:00′;
echo “zero1的时间为:”.$zero1.”
”;
echo “zero2的时间为:”.$zero2.”
”;
if(strtotime($zero1) echo “zero1早于zero2′;
}else{
 echo “zero2早于zero1′;
}
?>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template