PHP JSON如何减去日期和时间
我有php代码,我从json请求中提取了一个日期。json时间数据打印为 2017-07-01T07:32:57Z 你能举两个例子吗: 示例1如何用1天减去时间 示例2 php if语句PHP JSON如何减去日期和时间,php,json,Php,Json,我有php代码,我从json请求中提取了一个日期。json时间数据打印为 2017-07-01T07:32:57Z 你能举两个例子吗: 示例1如何用1天减去时间 示例2 php if语句 if(current time IS 60 Minutes > than JSON time and date){ echo "time is great than 60 minutes"; } 将日期减去1天,将日期替换为$your\u date\u time date('Y-m-d', strt
if(current time IS 60 Minutes > than JSON time and date){
echo "time is great than 60 minutes";
}
将日期减去1天,将日期替换为
$your\u date\u time
date('Y-m-d', strtotime('-1 day', strtotime($your_date_time)))
检查时间是否大于60分钟
if(strtotime($your_date_time) > strtotime("-60 minutes")) {
echo "time is great than 60 minutes";
}
希望这有帮助嗨,杰瑞,欢迎来到SO。请花点时间研究一下,以改进您的问题: