<h3>PHP Date Code Examples:</h3>
<p>Show the date 4 years earlier than now: <?php echo date("F d, Y", strtotime("-4 years")); ?></p>
<p>Show the date 4 days earlier than now: <?php echo date("F d, Y", strtotime("-4 days")); ?></p>
<p>Year only date format showing 4 years before now: <?php echo date("Y", strtotime("-4 years")); ?></p>
<p>Number of years difference calculation between now and 1971: </p>
<?php
// Get current time
$date1 = time();
// Get the timestamp of 1971
$date2 = mktime(0,0,0,0,0,1971);?>
<?php
$dateDiff = $date1 - $date2;
$fullYears = floor($dateDiff/(60*60*24*365.2422));
$fullDays = floor($dateDiff/(60*60*24));
$fullHours = floor(($dateDiff-($fullDays*60*60*24))/(60*60));
$fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60);
$oneDayAhead = ($date1 + (60*60)*24);
echo ("<p>The difference between now and 1971 is $fullYears years.</p><p>Specifically, that is " . $english_format_number = number_format($fullDays) . " days, $fullHours hours and $fullMinutes minutes.</p>");
?>
<p>And, one day ahead is <?php echo date("F d, Y", strtotime("+1 day")); ?>. </p>