konrms
5 months ago
71
11
Laravel

Date format in laravel controller

Posted 5 months ago by konrms

Hello guys.

I retrieve some data from my database student_data table. The date of birth inside the table is 19/04/95. (The format is dd/mm/yy). The data is retrieved with this command:

$d = DB::table('student_data')->value('date_of_birth');

But testing with dd($d) gives me this result:

"1995-04-19 00:00:00"

How can I alter dd($d) result to show date as follows?

19/04/1995

Thanks in advance.

Please sign in or create an account to participate in this conversation.