Home  >  Article  >  Backend Development  >  php常用的时间戳

php常用的时间戳

WBOY
WBOYOriginal
2016-06-20 12:58:32989browse

strtotime('now')strtotime('today')strtotime('tomorrow')strtotime('yesterday')strtotime(date('Y-m-d', strtotime('+1 day')))strtotime('tomorrow') - time()strtotime(”2009-1-22″)strtotime(”+1 day”)date(”Y-m-d H:i:s”,time())date(”Y-m-d H:i:s”,strtotime(”+1 day”))strtotime(”-1 day”)date(”Y-m-d H:i:s”,time()) date(”Y-m-d H:i:s”,strtotime(”-1 day”))strtotime(”+1 week”)date(”Y-m-d H:i:s”,strtotime(”+1 week”))strtotime(”-1 week”)date(”Y-m-d H:i:s”,strtotime(”-1 week”))strtotime(”next Thursday”)date(”Y-m-d H:i:s”,strtotime(”next Thursday”))strtotime(”last Thursday”)date(”Y-m-d H:i:s”,strtotime(”last Thursday”))

strtotime能将任何英文文本的日期时间描述解析为Unix时间戳;

结合mktime()或date()格式化日期时间获取指定的时间戳,实现所需要的日期时间。

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