Days before

From LemonWiki共筆
Jump to navigation Jump to search

7 days before[edit]

7 days before today[1]:

echo date('Y-m-d', strtotime('-7 days'));

7 days before the specific date e.g. 2021-02-28:

echo date('Y-m-d', strtotime('2021-02-28' . '-7 days'));
// will return 2021-02-21

References[edit]