Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Adding Dates To A Set Date
#2

[eluser]Kamarg[/eluser]
You need to update $added_date in your while loop. If you're wanting a php function to add dates, this is what I use.

Code:
function add_date($base_date, $days = 0, $months = 0, $years = 0){
    $cd = strtotime($base_date);
    $ret = date('m/d/Y', mktime(0, 0, 0, date('m', $cd) + $months, date('d', $cd) + $days, date('Y', $cd) + $years));
    return $ret;
}


Messages In This Thread
[SOLVED] Adding Dates To A Set Date - by El Forum - 10-25-2010, 07:38 AM
[SOLVED] Adding Dates To A Set Date - by El Forum - 10-25-2010, 07:51 AM
[SOLVED] Adding Dates To A Set Date - by El Forum - 10-25-2010, 09:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB