My Form has 2 fields - Time_from and Time_to
Now i need to add an entry in my database for each day (If theres is a difference between those days) ex. Time_from = 20
$date = new DateTime('2017-01-17'); $date->modify('+1 day'); echo $date->format('Y-m-d'); // 2017-01-18
You can do it too:
$dateTo = new \DateTime('1980-12-07 +1 day'); echo $dateTo->format('Y-m-d'); // 1980-12-08