php获取指定日期,前一天、前一周、前一个月、前一年,后一天,后一周,前一个月,前一年

dump( date( 'Y-m-d', strtotime('2018-10-1 +1 day') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 +1 week') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 +1 month') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 +1 year') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 -1 day') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 -1 week') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 -1 month') ) );

dump( date( 'Y-m-d', strtotime('2018-10-1 -1 year') ) );
---------------------
作者:kloumb
来源:CSDN
原文:https://blog.csdn.net/kloumb/article/details/84000700
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/xxllzizi/p/10186245.html