Skip to content

Date Arithmetic

Date arithmetic allows adding or subtracting time from a date.

$date = new DateTime();
$date->modify("+5 days");
echo $date->format("Y-m-d");
$date->modify("-1 month");