Home >Backend Development >PHP Tutorial >php gets today's start time and end time

php gets today's start time and end time

高洛峰
高洛峰Original
2017-03-01 16:57:322174browse

The example of this article describes the method of getting today's start time and end time in PHP. It has a very good reference value. Let's take a look at it with the editor.

Without further ado, please look at the code :

$begintime=date("Y-m-d H:i:s",mktime(0,0,0,date('m'),date('d'),date('Y')));
$endtime=date("Y-m-d H:i:s",mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1);

For more articles related to PHP getting today’s start time and end time, please pay attention to the PHP Chinese website!

Statement:
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