December 9, 2020
If you have a PHP DateTime
instance and want to add a certain number of days to it, you can use the modify
method. Here's an example:
$date = new DateTime('NOW')->modify('+1 day');
Now, $date
is a DateTime
1 day in the future from now.
You can substitute any number of days into the modify
method, or make it a variable like this:
$date = new DateTime('NOW')->modify("+{$daysToAdd} days");
Tufts Meal Plan Wrapped
Mar 2, 2024
Building an e-ink picture frame that displays an iCloud photo album
Jan 9, 2024
2023 in review
Jan 5, 2024
Subscribe to my newsletter for a monthly round-up of new blog posts and projects Iām working on!