Currently my code is adding a week, but I’m using Days instead of Weeks. I’ve read the documentation and don’t quite understand how it works.
# Adds 7 days to the project launch date.
$project_launch_date->add(new DateInterval('P7D'));
Instead of adding manual 7 days, how can I specify, ‘add a week’, or ‘add n weeks’?
If DateInterval is unclear for you, you can use more clear modify of DateTime class.
I prefer to use modify, because it makes code more readable without comments
In case you prefer to use DateInterval, here is good reference: http://www.php.net/manual/en/dateinterval.construct.php
So 5 weeks will be P5W, 3 month will be P3M, 5 weeks AND 3 month P3M5W and so on.