My shared hosting package at 1and1 only includes PHP 5.2.17 -- so I can't use the DateTime
object. Very annoying!
I currently have this code
$eventDate = new DateTime('2013-03-16'); // START DATE
$finishDate = $eventDate->add(new DateInterval('P'.$profile["Weeks"].'W'));
But obviously it won't work.
How can do I the same with code that will work with PHP5.2? (The code adds X number of weeks to a particular date.)
strtotime()
brings more problems than it seems to be. UseDateTime
class function to avoid strange bugs when calculating periods and you will never miss even a second. – Distract