文章已超过971天无更新,请确认内容是否可用
        $diyTime = '2019-12-10 12:30:30';
        //  获取五小时以前
        echo date('Y-m-d H:i:s', strtotime('-5 hours', strtotime($diyTime)));
        //  获取前一天
        echo date('Y-m-d H:i:s', strtotime('-1 day', strtotime($diyTime)));
        //  获取上一月
        echo date('Y-m-d H:i:s', strtotime('-1 month', strtotime($diyTime)));
        //  获取五小时以后
        echo date('Y-m-d H:i:s', strtotime('+5 hours', strtotime($diyTime)));
        //  获取后一天
        echo date('Y-m-d H:i:s', strtotime('+1 day', strtotime($diyTime)));
        //  获取下一月
        echo date('Y-m-d H:i:s', strtotime('+1 month', strtotime($diyTime)));
        //  获取当前时间的指定范围
        echo date('Y-m-d H:i:s', strtotime('+1 month'));
                    喜欢就支持一下吧!
版权声明:除却声明转载或特殊注明,否则均为艾林博客原创文章,分享是一种美德,转载请保留原链接,感谢您的支持和理解