I have a series of multiple different dates and I want to change them all by the same number. I only know the new date value of the first of the dates.
If I wanted to increase them all by the same value, I thought id just substract the current date from the new date to get the Time difference and add that to all the other dates. How would i go about doing that? I know the add function but this is done using a DateInterval, which i have no idea to create out of a date.
Example: i have the dates 2016-01-19 00:00, 2016-02-19 00:00, 2016-02-19 00:00 and i know the first one has to get changed to 2016-01-20 00:00. Based on the difference between them i want to calculate how much i have to increase the other 2 dates by.
So basically
$Interval = strtotime(16-01-20 00:00) - strtotime(16-01-19 00:00);
$newTime = strtotime(16-02-19 00:00) + $Interval;
I solved the problem now, which was that i had put the $Interval in a strtotime aswell. I overread that completely, thinking it wasn't the cause of the error