Home  >  Article  >  php教程  >  php 当前时间: 用php实现将当前日期时间减去一个小时

php 当前时间: 用php实现将当前日期时间减去一个小时

WBOY
WBOYOriginal
2016-06-21 08:49:503163browse

date_default_timezone_set('Asia/Shanghai');//此句用于消除时间差
$nowtime=date("Y-m-d H:i:s");
echo date('Y-m-d H:i:s',strtotime("$nowtime-1 hour"));
hour小时
minute分钟
year年
month月
day日
本文链接http://www.cxybl.com/html/wlbc/Php/20130523/37995.html



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