Date intervals add or subtract calendar amounts from a date.

Add Days

add_days.php
<?php
$days = ;
$start = new DateTimeImmutable("2026-05-31", new DateTimeZone("UTC"));
$end = $start->add(new DateInterval("P" . $days . "D"));

echo "days=" . $days . "\n";
echo "end=" . $end->format("Y-m-d") . "\n";
<?php
$days = ;
$start = new DateTimeImmutable("2026-05-31", new DateTimeZone("UTC"));
$end = $start->add(new DateInterval("P" . $days . "D"));

echo "days=" . $days . "\n";
echo "end=" . $end->format("Y-m-d") . "\n";
<?php
$days = ;
$start = new DateTimeImmutable("2026-05-31", new DateTimeZone("UTC"));
$end = $start->add(new DateInterval("P" . $days . "D"));

echo "days=" . $days . "\n";
echo "end=" . $end->format("Y-m-d") . "\n";
interval `DateInterval` describes the change, and `add` returns the adjusted date.