<?php
//the number of months to subtract
$subtractmonths = '3';
$fulldate = date("m.d.y");
$currentyear = date("y");
$currentmonth = date("m");
$currentday = date("d");
$subtract = date("m")-$subtractmonths;
echo "today's date is $fulldate<br>";
echo "$subtractmonths months(s) ago it was $subtract.$currentday.$currentyear";
?>
__________________ Anthony LeBoeuf Cape-Tek IT Solutions
<?php // how many months to subtract $monthssubtract = "13"; //get timestamp for past/future date I want $pf_time = strtotime("-$monthssubtract months"); //format the date using the timestamp generated $actual_date = date("F j, Y"); $pf_date = date("F j, Y", $pf_time); echo "Today is $actual_date<br>"; echo "$monthssubtract months ago it was $pf_date";
?>
__________________ Anthony LeBoeuf Cape-Tek IT Solutions
I thought it was something like
date()-(60*60* 60 *24*31)
being that we are going by seconds, 60*60 is 1 minute, *60 is 1hr, *24 is one day, *31 is one month
__________________
I have the heart of a child, I keep it in a jar on my desk.