Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

swist's avatar
Level 11

Carbon addDays but without modyfing existing instance

Hi,

I would like to get +few days of an existing Carbon instance. However I don't wont to change existing instance so this is not an option:

<?php
// $start is an instance of Carbon
$new_date = $start->addDays(5)
// now $start points 5 days ahead

How to do it without modyfing old instance?

0 likes
3 replies

Please or to participate in this conversation.