7

I am using php version 5.4.24 and I can't use the class DateInterval.
I get this error: PHP Fatal error: Class 'DateInterval' not found

$interval       = new DateInterval('P91D');

What should I do in order to make this code work?

1 Answers1

15

You need to add the following class in the Controllers. Also make sure your php version (PHP 5 >= 5.3.0, PHP 7)

use DateTime;
use DatePeriod;
use DateInterval;

class DashboardController extends Controller
{

}
Kalidass
  • 424
  • 3
  • 18