Jump to content

Stupid Question about date calculations ...


bsamson

Recommended Posts

You might have to change this slightly depending on the format you're using for dates.

 

$date	= "06282008";	// Todays date

$month	= substr($date, 0, 2);
$day	= substr($date, 2, 2);
$year	= substr($date, 4, 4);

echo date("m/d/Y", mktime(1, 1, 1, $month, ($day+15), $year));

 

If this confuses you just read up on the mktime() PHP function and should be clear.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.