Suppose the code is executed on 2018-07-31, how can the output be 2018-07-01? date(“Y-m-d”,strtotime(“-1 month”)) Okay, although this question seems very confusing, but from the internal logic, it is actually “right”: Let’s simulate the processing logic for this kind of thing inside date: 1. First do -1 month, then the current is 07-31, and after… Read more Confusing strtotime