PHP 时间加减

PHP About 621 words

API

year(年),month(月),day(日),hour(时),minute(分),second(秒)

昨天
date("Y-m-d", strtotime("-1 day"))
今天
date("Y-m-d")
明天
date("Y-m-d", strtotime("+1 day"))
五秒钟后
date("Y-m-d H:i:s", strtotime("+5 second"))
五分钟后
date("Y-m-d H:i:s", strtotime("+5 minute"))
五小时后
date("Y-m-d H:i:s", strtotime("+5 hour"))
五个月后
date("Y-m-d H:i:s", strtotime("+5 month"))
五年后
date("Y-m-d H:i:s", strtotime("+5 year"))

date('Y-m-d H:i:s',strtotime("+1 day +1 hour +1 minute");

一周后
date("Y-m-d",strtotime("+1 week"))
下个星期四
date("Y-m-d",strtotime("next Thursday"))
上个周一
date("Y-m-d",strtotime("last Monday"))
一个月前
date("Y-m-d",strtotime("last month"))
Views: 2,564 · Posted: 2019-04-08

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh