The DateTime object in PHP simplifies date and time manipulation In the previous article, we looked at some of the most frequently used date and time functions within PHP. What we haven’t covered is time manipulation. How do you add 2 weeks to a current date-time or how many days are between two dates? That’s where the DateTime object shines. The DateTime Object DateTime is a class that’s built into PHP. That means that you can instantiate it without doing anything special. <?php $datetime = new DateTime(); var_dump($datetime); /app/95 DateTime Object/index.php:3: object(DateTime)[1] public ‘date’ => string ‘2022-11-20 19:33:12.650004’ (length=26) public