Because you are using data-type timestamp which in turn is an instance of time in "Y-m-d H:i:s Z". You can use some column with data-type "date" but created_at follows the exact same as mentioned above.
Sep 20, 2015
2
Level 1
Date mutators throw exception if i change $dateFormat
I've set $dates and $dateFormat on my model ( http://laravel.com/docs/5.1/eloquent-mutators#date-mutators )
The funny this is that if i change $dateFormat to anything other than protected $dateFormat = 'Y-m-d H:i:s' it gives me the following exception whenever i try to display the time $model->created_at->getTimestamp()
It results in this:
ErrorException in Carbon.php line 414:
Trailing data (View: /home/vagrant/Projects/kpst/resources/views/polls/index.blade.php)
And by anything, i mean literally anything. Even just protected $dateFormat = 'Y-m-d' will throw the exception
Am i doing something wrong?
Please or to participate in this conversation.