Add Day Issue

If you want to add 1 day to a date, 

DO NOT use following statement, this will cause unknwon problem:

$current_date = date('Y-m-d', strtotime($current_date) + 60*60*24);


Change to this one:

$current_time = strtotime($current_date);
$current_time = strtotime("+1 day", $current_time);
$current_date = date('Y-m-d', $current_time);

$current_from = date('Y-m-d G:i', strtotime("+1 day", strtotime($current_from)));


Use SQL directly:

DATE_ADD('" . $date . "', INTERVAL 1 DAY)


2 thoughts on “Add Day Issue

  1. Hi there, this weekend is nice in favor of me, as this time i am reading this enormous educational post here at my residence.

Comments are closed.