我的代碼是:$result = 20201601; //fetched from a source as string//Convert string to date format 'Y/m/d'$date1 = substr($result, 0, 4) . '/' . substr($result, 4, 2) . '/' . substr($result, 6, 2); echo $date1 . "<br>";//Add 30 days to it$date2 = date('Y/m/d', strtotime('+30 days', strtotime($date1)));echo $date2;if ($date2 < date('Y/m/d', strtotime('now'))){ //If date fetched ($result) is older than 30 days from today's date, then fetch new date from source}代碼未能在: 添加 30 天date('Y/m/d', strtotime('+30 days', strtotime($date1))),它給出:1970/01/30
strtotime 未能及時添??加 30 天
慕工程0101907
2022-07-22 18:47:51