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