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');
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments