企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ### 函数 ``` function getAfterMonth($newMonth, $num){ $nowMonth = date('Y-m-d H:i:s', strtotime($newMonth."01")); $timestamp = strtotime("{$nowMonth} -$num month"); $newMonth = date('Ym', $timestamp); return $newMonth; } echo getAfterMonth('202001','0').PHP_EOL; // 202001 echo getAfterMonth('202001','1').PHP_EOL; // 201912 echo getAfterMonth('202001','2').PHP_EOL; // 201911 ```