Example code for the month difference between two times:
The code is as follows | |||||
$yourdate="2012-10- 20";
|
Example 1
The code is as follows | |||||
/*
|
例子2
代码如下 | |||||||||||||||||||||
$one = strtotime('2011-05-08 07:02:40');//开始时间 时间戳
/* 这个只是提示
echo "两个时间相差 $d 天 $h 小时 $m 分"
例子4
例子四是我最喜欢的一个可以计算到天小时秒哦,当然具体的还是需要根据自己的需要了。
Previous article:Build and configure apache+php+mysql under windows8.1, windows8.1apache_PHP tutorial
Next article:Re-indexing of deleted elements in php array, php array element index_PHP tutorial
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
Latest Articles by Author
Latest Issues
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|