In php, the strtotime Method & nbsp; often needs to calculate the date. for example, to calculate the date one month ago, the fastest way is to use strtotime, the strtotime method is quite useful in echostrtotime (now), n; echostrtotime (10September2000), n; echostrtoti php.
In PHP, it is often necessary to calculate the date. for example, to calculate the date a month ago, it is actually the fastest way.
Strtotime is used, and its functions are rich as follows:
Echo strtotime ("now"), "\ n"; echo strtotime ("10 September 2000"), "\ n"; echo strtotime ("+ 1 day "), "\ n"; echo strtotime ("+ 1 week"), "\ n"; echo strtotime ("+ 1 week 2 days 4 hours 2 seconds "), "\ n"; echo strtotime ("next Thursday"), "\ n"; echo strtotime ("last Monday"), "\ n ";
If we see no more than 1 day + 1 week, we can find the date after 1 day and 1 week,
If you want to calculate a month ago, you can:
Echo date ('Y-m-D', strtotime ('1 month ago '))
Therefore, you can determine whether a month ago
If strtotime ($ my_date) <strtotime ('1 month ago '))