Another macro language I used had a newdate function. Pass it a data and an
offset in number of days and it would return the new date. I duplicated it
in php here:
function newdate( $strdate, $ndays)
{
# strtotime doesn't like dashes
$strdate = str_replace("-","/",$strdate);
$temp = strtotime
$today=mktime(0,0,0,date("m"),date("d"),date("Y"));
$last_week=mktime(0,0,0,date("m",mktime(0,0,0,date("m"),date("d")-7,date("Y"
))),date("d",mktime(0,0,0,date("m"),date("d")-7,date("Y"))),date("Y",mktime(
0,0,0,date("m"),date("d")-7,date("Y";
echo date("d",$today)-date("d",$last_week);
--
2 matches
Mail list logo