私は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**