Adding days to a timestamp

后端 未结 7 1324
春和景丽
春和景丽 2021-02-05 07:59

Giving a starting date, I\'m adding four times seven days to get 5 different dates separated exactly a week each one.

//$date = \'28-10-2010\';
$timestamp = mkti         


        
7条回答
  •  情深已故
    2021-02-05 08:32

    I have had a great deal of success with this methodology for adding days, though i have not tested with your format:

    $date = The value of the database from your query
    $daysahead = The number of days ahead you want to calculate
    $final_date = date(“m/d/Y”, strtotime($date) + (86400 * $daysahead));
    
    echo $final_date;
    

提交回复
热议问题