Add a day but at a specific time PHP

0

Good morning greetings from Peru I have a function that adds one day is for a hotel system so it should leave the next day always at noon then if I rent a room at 3 pm today the output will be at noon tomorrow this is the line that is responsible for adding a day but should be at 12 noon always

$fecha = date("Y-m-d H:i:s", strtotime("$fecha + 1 day")); //Aumente en un dia
    
asked by Jose Manuel Bazan de la Cruz 24.06.2018 в 16:25
source

1 answer

0

You add a day to the date without an hour and then add the time since it is always the same.

$fecha = date("Y-m-d", strtotime($fecha." + 1 day")). " 12:00:00";
    
answered by 24.06.2018 в 18:32