我正在使用Symfony2.从数据库中获取日期时,我需要在我的数据库中显示日期index.html.php.
当我打印它的显示如下: DateTime Object ( [date] => 2012-10-09 13:30:23 [timezone_type] => 3 [timezone] => UTC )
但是当我将对象转换为int时它的给出错误: $days2 = floor( $entities->getCreationDate() / (60 * 60 * 24));
Notice: Object of class DateTime could not be converted to int**
Run Code Online (Sandbox Code Playgroud)