Home  >  Article  >  Backend Development  >  PHP setTime code to set the current time_PHP tutorial

PHP setTime code to set the current time_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:16:291044browse

Copy code The code is as follows:

function _niceTime($minute){
$m = $minute - 5;
$date = new DateTime();
$date->setTime(9, 00);//Set 9 o'clock every morning
return date("Y-m-d H:i",strtotime("+$m minute ",$date->getTimestamp()));
}

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325914.htmlTechArticleCopy the code as follows: function _niceTime($minute){ $m = $minute - 5; $date = new DateTime(); $date-setTime(9, 00);//Set return date("Y-m-d H:i",strtotime("+...
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