Script to find the date 30 days before the current date
<?php
// Get the current date $currentDate = date(“Y-m-d”);
// Subtract 30 days from the current date
$pastDate = date(“Y-m-d”, strtotime(“-30 days”, strtotime($currentDate)));
// Output the result
echo “Current Date: ” . $currentDate . “<br>”;
echo “Date 30 Days Before: ” . $pastDate;
?>
Please login to post a comment.