Fix undefined method for PHP 5.2 on DateTime