Convert Timestamp To Date In Laravel?
Answer : timestamp columns like created_at are being parsed first. the U is simply the timestamp format. you can return your own format. for other formats see date docs. edit: as stated in my comment, getDateFormat() is for both ways (insert, selects). your best bet would be using format inside the model. example: public function getMyBirthdayAttribute() { return $this->my_birthday->format('d.m.Y'); } use $model->my_birthday to call the attribute. // controller $posts = Post::all(); // within sometemplate.blade.php @foreach($posts as $post) my formatted date: {{ $post->my_birthday }} @endforeach The better way to manage dates with Laravel IMHO is to use the getDates accessor that is build into Laravel. All you need to do is to set a method on your Model as such. public function getDates() { return [ 'my_birthday', 'created_at', 'updated_at', ]; } This will return a Carbon object. Carbon is insa