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

PHP setTime code to set the current time_PHP tutorial

WBOY
Release: 2016-07-21 15:16:29
Original
1124 people have browsed it

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("+...
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