This article mainly introduces the method of obtaining the timestamp of today, yesterday, and tomorrow in PHP. It analyzes the common usage techniques of strtotime function with examples. It is very simple and practical. Friends in need can refer to it.
The details are as follows:
echo strtotime('now'),'<br>';//现在 echo strtotime('today'),'<br>';//今天 echo strtotime('tomorrow'),'<br>';//明天 echo strtotime('yesterday'),'<br>';//昨天
The running results are as follows:
1469674869
1469664000
1469750400
1469577600
The rest of today Number of seconds:
echo $time_remain = strtotime('tomorrow') - time(); //输出:75531
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
PHP object , Case analysis of advanced features of patterns and practices
##How to use try{}catch{} in PHP
The above is the detailed content of How to implement the timestamp of today, yesterday and tomorrow in PHP. For more information, please follow other related articles on the PHP Chinese website!