php获取指定日期的前一天,前一月,前一年日期
php获取指定日期的前一天,前一月,前一年日期
前一天的日期为:
date("Y-m-d",strtotime("-1 days",strtotime('2019-08-31')))
前一月的日期为
date("Y-m-d",strtotime("-1 months",strtotime('2019-08-31')))
前一年的日期为:
date("Y-m-d",strtotime("-1 years",strtotime('2019-08-31')))
后一天的日期为:
date("Y-m-d",strtotime("+1 days",strtotime('2019-08-31')))
后一月的日期为:
date("Y-m-d",strtotime("+1 months",strtotime('2019-08-31')))
后一年的日期为:
date("Y-m-d",strtotime("+1 years",strtotime('2019-08-31')))
如果不是1,就把+1或者-1换成+n或者-n就可以了。
本文属原创,转载请注明原文:https://www.zhimatong.com/jiaocheng/254.html
为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。
内容有用



交流群
购物车