Home / PHP Tips Generated By ChatGPT / Using DateTime and DateInterval in PHP Manipulate and calculate dates and times efficiently. Source Code $datetime = new DateTime('now'); $datetime->add(new DateInterval('P1D')); // Adds one day echo $datetime->format('Y-m-d');