Subtract 1 day with PHP

For Subtract 1 day use this code:

Please replace your date with ‘2012-12-12‘.

$first_date = strtotime('2012-12-12');
$second_date = strtotime('-1 day', $first_date);

print 'First Date ' . date('Y-m-d', $first_date);
print 'Next Date ' . date('Y-m-d', $second_date);

Leave a Comment