Home >Backend Development >PHP Tutorial >PHP怎么表示某一个时间的前一天12点

PHP怎么表示某一个时间的前一天12点

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:27:081019browse


某个时间的前一天12点,  怎么用PHP算出来

某个时间为变量。


回复讨论(解决方案)

<?phpdate_default_timezone_set('PRC');$now = time(); //某个时间,可以是任意时间戳$ago = strtotime('-1 day 12:00:00', $now); //一天前的12:00:00的时间戳,两天前-2 day即可echo date('Y-m-d H:i:s', $ago);

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