SyntaxFix
Write A Post
Hire A Developer
Questions
You can use strtotime:
strtotime
$date = strtotime('2010-01-01 -1 year');
The strtotime function returns a unix timestamp, to get a formatted string you can use date:
date
echo date('Y-m-d', $date); // echoes '2009-01-01'