我操縱碳日期對象($subscription->updated_at
),其具有的問題:問題操縱PHP中的碳日期對象/ Laravel
$thisDate = $subscription->updated_at->date;
$thisDate = Date($graphDateFormat, $thisDate);
結果Unknown getter 'date'
$thisDate = $subscription->updated_at;
$thisDate = Date($graphDateFormat, $thisDate);
結果date() expects parameter 2 to be long, object given
var_dump($subscription->updated_at);
結果於:
object(Carbon\Carbon)[292]
public 'date' => string '2013-08-21 17:05:19' (length=19)
public 'timezone_type' => int 3
public 'timezone' => string 'UTC' (length=3)
如何在Date()函數內使用Carbon日期?
嘗試'$訂閱 - > updated_at-> toDateTimeString();' –